summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir@cohens.org.il>2010-04-24 15:35:27 +0300
committerTzafrir Cohen <tzafrir@cohens.org.il>2010-04-24 15:35:27 +0300
commitb1c9c13780b5ffa7cce40bdb25cb0ec8348d880f (patch)
treed9bab5771a820e623d1406b997424024ff6fffbc
parenta5bef393150fe8ac6a520cb062aea612704f1917 (diff)
proper name and "email"
Use the user's Real Name for the name, and $user@$reviewboard_server as "email".
-rwxr-xr-xrb-branch3
-rwxr-xr-xrb-patch8
2 files changed, 6 insertions, 5 deletions
diff --git a/rb-branch b/rb-branch
index 804b815..5df323c 100755
--- a/rb-branch
+++ b/rb-branch
@@ -18,7 +18,8 @@ if [ ! -x "$rb_patch" ]; then
fi
$rb_patch "$@" >"$tmp_patch_file"
-branch=`grep '^Svn-Branch:' $tmp_patch_file | sed -e 's|.*/||'`
+# For the branch name: leave only the final path component
+branch=`awk '/^Svn-Branch:/ {print $2}' $tmp_patch_file | sed -e 's|.*/||'`
svn_branch="${svn_branch_prefix}svn_$branch"
review_num=`awk '/^Review:/ {print $2}' $tmp_patch_file`
diff_num=`awk '/^Diff:/ {print $2}' $tmp_patch_file`
diff --git a/rb-patch b/rb-patch
index 80091c3..eeaa800 100755
--- a/rb-patch
+++ b/rb-patch
@@ -47,8 +47,8 @@ die "$0: Failed to get reviewboard page $diff_page_url\n" unless defined $conten
my @page = split(/\n/, $content);
$content =~ m{<h1 id="summary" class="editable">([^<]*)</h1>};
my $summary = $1;
-$content =~ m{<a id="submitter" href="[^"]*">([^<]*)</a>};
-my $name = $1;
+$content =~ m{<a id="submitter" href="/users/([^/]*)/">([^<]*)</a>};
+my ($user_name, $full_name) = ($1, $2);
$content =~ m{<span id="branch" class="editable">([^<]*)</span>};
my $branch = $1;
$content =~ m{var gRevision = '(\d+)';};
@@ -63,7 +63,7 @@ die "$0: Failed to get raw diff $diff_url".($response->status_live)."\n"
my $raw_diff = $response->content;
my $date = $response->header('Date');
-my $checksum = sha1_hex("${review_num}::${diff_num}::${name}::{$date}");
+my $checksum = sha1_hex("${review_num}::${diff_num}::${user_name}::${date}");
#my @head = head($diff_page_url);
##my $date = $head[2];
#my $date = join '>|<', @head;
@@ -77,7 +77,7 @@ $raw_diff =~ s{\n\+\+\+ }{$&b/}g;
print
"From $checksum $date
-From: $name <$name\@$reviewboard_server>
+From: $full_name <$user_name\@$reviewboard_server>
Date: $date
Subject: [PATCH] $summary