diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-05-06 10:03:10 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-05-06 10:03:10 -0300 |
commit | 76775b7f2ced0c0301ac3ae201aafc3d9b88e091 (patch) | |
tree | f0ad9167da8049f5b468fe5a58a1f438450665d6 /v4l/scripts/prep_commit_msg.pl | |
parent | 8ab655cc3c286a78e3af8ac2a88a839ea073306a (diff) | |
parent | 46cf6abc45f699c5843872c7ef8e782e4d0e1a27 (diff) | |
download | mediapointer-dvb-s2-76775b7f2ced0c0301ac3ae201aafc3d9b88e091.tar.gz mediapointer-dvb-s2-76775b7f2ced0c0301ac3ae201aafc3d9b88e091.tar.bz2 |
merge: http://linuxtv.org/hg/~aapot/m920x
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l/scripts/prep_commit_msg.pl')
-rwxr-xr-x | v4l/scripts/prep_commit_msg.pl | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/v4l/scripts/prep_commit_msg.pl b/v4l/scripts/prep_commit_msg.pl index f4047c6ba..cb0740a5d 100755 --- a/v4l/scripts/prep_commit_msg.pl +++ b/v4l/scripts/prep_commit_msg.pl @@ -1,5 +1,10 @@ #!/usr/bin/perl +my $diff = 'diff'; +if ($ARGV[0] eq '-q') { + $diff = 'qdiff'; + shift; +} my $autopatch = shift; # Get Hg username from environment @@ -45,13 +50,31 @@ if ($user eq "") { } print "# Added/removed/changed files:\n"; -system "hg diff | diffstat -p1 -c"; +system "hg $diff | diffstat -p1 -c"; if (-s $autopatch) { print "#\n# Note, a problem with your patch was detected! These changes were made\n"; print "# automatically: $autopatch\n"; system "diffstat -p0 -c $autopatch"; print "#\n# Please review these changes and see if they belong in your patch or not.\n"; } +if ($diff eq 'qdiff') { + # Use existing mq patch logfile? + open IN, "hg qheader |"; + my @header = <IN>; + close IN; + + if ($#header > 0) { + # Use existing header + print @header; + exit; + } + # No header, use pre-made log message below + + # Hg will strip lines that start with "From: " from mq patch headers! + # In order to stop it, we insert this extra From line at the top, + # Hg will strip it and then leave the real from line alone. + print "From: $user\n\n"; +} print <<"EOF"; # # For better log display, please keep a blank line after subject, after from, |