From da4bf4260d1fe9964768ced721f2cbcb8c740850 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 12 Jun 2006 17:05:52 -0300 Subject: mailimport improved to accept "hg export" patches From: Mauro Carvalho Chehab Now, script will detect "hg export" patches inside emails, removing non-pertinent headers, keeping only the original commit message and the patch. Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/hghead.pl | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'v4l/scripts') diff --git a/v4l/scripts/hghead.pl b/v4l/scripts/hghead.pl index ddaef0767..16e566ea9 100755 --- a/v4l/scripts/hghead.pl +++ b/v4l/scripts/hghead.pl @@ -8,10 +8,10 @@ use Date::Parse; my $in = shift; my $line; my $subject; -my $from=0; my $sub_ok=0; my $init=0; my $num=0; +my $hgimport=0; my $maint_ok=0; my $noblank=1; my $maintainer_name=$ENV{CHANGE_LOG_NAME}; @@ -87,6 +87,20 @@ while ($line = ) { $signed="$signed$line"; next; } + if ($line =~ m/^\# HG changeset patch/) { + $sub_ok=0; + $init=0; + $num=0; + $hgimport=0; + $maint_ok=0; + $noblank=1; + $from=""; + $body=""; + $subject=""; + $hgimport=1; + next; + } + if ($line =~ m/^Acked-by:.*/) { $signed="$signed$line"; next; @@ -96,7 +110,7 @@ while ($line = ) { if ($line =~ m/Changeset:\s*(.*)\n/) { $num=$1; } - print "# $line"; +# print "# $line"; next; } @@ -105,12 +119,19 @@ while ($line = ) { $line="\n"; } + if ($line =~ m/^#/) { + next; + } if ($sub_ok == 0) { $sub_ok=1; substr( $subject, 0, 1 ) = uc (substr ($subject, 0, 1)); if ($subject =~ m|V4L\/DVB\s*(.+)|) { $subject=$1; } + if ($hgimport) { + $subject=$line; + next; + } if ($line =~ m/^\n/) { next; } -- cgit v1.2.3