summaryrefslogtreecommitdiff
path: root/v4l/scripts/prep_commit_msg.pl
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2007-04-26 10:40:35 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2007-04-26 10:40:35 -0300
commit5da5e2ce7dd4b27ccdfd1328f2f9140dd5708f6b (patch)
tree30979e50bc71541b64476993e6c8758c67ccca24 /v4l/scripts/prep_commit_msg.pl
parent2a94f8dbe2011b5c5721a9e681a745e25ec3b4e8 (diff)
parent54d44a36f1f7fc565e4a4bedeac90b3e6efbbf97 (diff)
downloadmediapointer-dvb-s2-5da5e2ce7dd4b27ccdfd1328f2f9140dd5708f6b.tar.gz
mediapointer-dvb-s2-5da5e2ce7dd4b27ccdfd1328f2f9140dd5708f6b.tar.bz2
merge: http://linuxtv.org/hg/~hverkuil/v4l-dvb
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-xv4l/scripts/prep_commit_msg.pl25
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,