summaryrefslogtreecommitdiff
path: root/v4l/scripts/hghead.pl
diff options
context:
space:
mode:
Diffstat (limited to 'v4l/scripts/hghead.pl')
-rwxr-xr-xv4l/scripts/hghead.pl42
1 files changed, 22 insertions, 20 deletions
diff --git a/v4l/scripts/hghead.pl b/v4l/scripts/hghead.pl
index 1eb7355c4..2450ad136 100755
--- a/v4l/scripts/hghead.pl
+++ b/v4l/scripts/hghead.pl
@@ -91,7 +91,8 @@ while ($line = <IN>) {
}
if ($tag =~ m/^subject:/) {
- $subject="$arg\n";
+ $subject = "$arg\n";
+ $sub_ok = 1;
next;
}
@@ -125,21 +126,18 @@ while ($line = <IN>) {
next;
}
- if ($tag =~ m/^(acked-by|thanks-to|reviewed-by|cc):/) {
+ if ($tag =~ m/^(acked-by|thanks-to|reviewed-by|noticed-by|cc):/) {
$signed="$signed$line";
next;
}
- if ($line =~ m/^[a-zA-Z\-]*:/) {
- if ($line =~ m/Changeset:\s*(.*)\n/) {
- $num=$1;
- }
- print "# $line";
- next;
+ if ($tag =~ m/changeset:\s*(.*)\n/) {
+ $num=$1;
}
if ($line =~ m|^(V4L\/DVB\s*\(.+\)\s*:.*\n)|) {
$subject=$1;
+ $sub_ok = 1;
$line="\n";
}
@@ -151,17 +149,11 @@ while ($line = <IN>) {
next;
}
$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;
- }
+ $subject=$line;
+ next;
}
if ($noblank) {
@@ -182,7 +174,8 @@ if ($from eq "") {
die;
}
-if (!$maint_ok) {
+if (!$maint_ok && $maintainer_name && $maintainer_email) {
+ print "#No maintainer's signature. Adding it.\n";
$signed=$signed."Signed-off-by: $maintainer_name <$maintainer_email>\n";
}
@@ -191,11 +184,20 @@ if (!$signed =~ m/$from/) {
die;
}
-$body="$from\n$body";
+$from=~s/^[\n\s]+//;
+$from=~s/[\n\s]+$//;
+
+$subject=~s/^[\n\s]+//;
+$subject=~s/[\n\s]+$//;
+
+$body=~s/^[\n\s]+//;
$body=~s/[\n\s]+$//;
+
+$body="$body\n\n$signed";
+
$body=~s/^[\n\s]+//;
+$body=~s/[\n\s]+$//;
# First from is used by hg to recognize commiter name
print "#Committer: $maintainer_name <$maintainer_email>\n";
-print "$subject\n$body\n\n$signed";
-
+print "$subject\n\n$from\n\n$body\n";