subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1568246 - /subversion/trunk/tools/dist/backport.pl
Date Fri, 14 Feb 2014 11:35:17 GMT
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 $_;
 }
 



Mime
View raw message