You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by da...@apache.org on 2014/02/14 12:35:17 UTC
svn commit: r1568246 - /subversion/trunk/tools/dist/backport.pl
Author: danielsh
Date: Fri Feb 14 11:35:17 2014
New Revision: 1568246
URL: http://svn.apache.org/r1568246
Log:
backport.pl: Minor improvements to sanitize_branch() helper.
* tools/dist/backport.pl
(sanitize_branch): Add a docstring. Restore support for some input formats
that r1541813 accidentally removed (presumably because they weren't
documented ☺).
Modified:
subversion/trunk/tools/dist/backport.pl
Modified: subversion/trunk/tools/dist/backport.pl
URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dist/backport.pl?rev=1568246&r1=1568245&r2=1568246&view=diff
==============================================================================
--- subversion/trunk/tools/dist/backport.pl (original)
+++ subversion/trunk/tools/dist/backport.pl Fri Feb 14 11:35:17 2014
@@ -325,12 +325,23 @@ EOF
unlink $logmsg_filename unless $? or $!;
}
+# Input formats:
+# "1.8.x-r42",
+# "branches/1.8.x-r42",
+# "branches/1.8.x-r42/",
+# "subversion/branches/1.8.x-r42",
+# "subversion/branches/1.8.x-r42/",
+# "^/subversion/branches/1.8.x-r42",
+# "^/subversion/branches/1.8.x-r42/",
+# Return value:
+# "1.8.x-r42"
+# Works for any branch name that doesn't include slashes.
sub sanitize_branch {
local $_ = shift;
- my $branches_re = quotemeta $BRANCHES;
- s#.*$branches_re/##;
s/^\s*//;
s/\s*$//;
+ s#/*$##;
+ s#.*/##;
return $_;
}