diff options
-rwxr-xr-x | mailimport | 7 | ||||
-rwxr-xr-x | v4l/scripts/hghead.pl | 26 |
2 files changed, 20 insertions, 13 deletions
diff --git a/mailimport b/mailimport index c7e1bf80a..b072bf5f3 100755 --- a/mailimport +++ b/mailimport @@ -87,6 +87,7 @@ apply_patch () { done committer=`grep "Committer:" $TMP2|sed s/"#Committer: "//` + date=`grep "Date:" $TMP2|sed s/"#Date: "//` if [ "$usemq" != "" ]; then name=`cat $next | perl -ne ' @@ -106,8 +107,8 @@ apply_patch () { cat $next| grep -v "^#" >$TMPDIR/$name - echo hg -m "`cat $TMP2|grep -v "^#"`" qnew $name - hg qnew -m "`cat $TMP2|grep -v "^#"`" $name + echo hg -d "$date" -m "`cat $TMP2|grep -v "^#"`" qnew $name + hg qnew -d "$date" -m "`cat $TMP2|grep -v "^#"`" $name make cardlist make whitespace hg qrefresh @@ -142,7 +143,7 @@ apply_patch () { exit fi - hg commit -u "$committer" -m "`cat $TMP2|grep -v "^#"`" $CARDLIST $FILES + hg commit -d "$date" -u "$committer" -m "`cat $TMP2|grep -v "^#"`" $CARDLIST $FILES if [ "$?" != "0" ]; then echo "*** ERROR at hg commit" diff --git a/v4l/scripts/hghead.pl b/v4l/scripts/hghead.pl index dd4cedee6..7b3f3106d 100755 --- a/v4l/scripts/hghead.pl +++ b/v4l/scripts/hghead.pl @@ -47,15 +47,22 @@ while ($line = <IN>) { if ($line =~ m/^Date:\s*(.*)/) { my $time = str2time($1); -# my $timestr = gmtime($time); if ($time) { - print "# Date: $time\n"; + print "#Date: $1\n"; } next; } - if ($line =~ m/^From:/) { - if ($line =~ m/^From:[\s\"]*([^\"]*)[\s\"]*<(.*)>/) { + + my $tag=$line; + my $arg=$line; + $tag =~ s/\s*([^\s]+:)(.*)\n/\1/; + $arg =~ s/\s*([^\s]+:)(.*)\n/\2/; + + $tag =~ tr/A-Z/a-z/; + + if ($tag =~ m/^from:/) { + if ($arg =~ m/^[\s\"]*([^\"]*)[\s\"]*<(.*)>/) { if ($1 eq "") { next; } @@ -75,8 +82,8 @@ while ($line = <IN>) { die; } - if ($line =~ m/^Subject:\s*(.*\n)/) { - $subject=$1; + if ($tag =~ m/^subject:/) { + $subject="$arg\n"; next; } @@ -87,7 +94,7 @@ while ($line = <IN>) { next; } - if ($line =~ m/^Signed-off-by:.*/) { + if ($tag =~ m/^signed-off-by:.*/) { $noblank=1; if ($line =~ m/$maintainer_name/) { $maint_ok=1; @@ -110,8 +117,7 @@ while ($line = <IN>) { next; } - - if ($line =~ m/^(Acked-by|Acked-By|acked-by|Thanks-to|cc|CC|Cc):.*/) { + if ($tag =~ m/^(acked-by|thanks-to|reviewed-by|cc):/) { $signed="$signed$line"; next; } @@ -120,7 +126,7 @@ while ($line = <IN>) { if ($line =~ m/Changeset:\s*(.*)\n/) { $num=$1; } -# print "# $line"; + print "# $line"; next; } |