subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1507643 - /subversion/trunk/tools/dist/backport.pl
Date Sat, 27 Jul 2013 13:58:02 GMT
Author: danielsh
Date: Sat Jul 27 13:58:01 2013
New Revision: 1507643

URL: http://svn.apache.org/r1507643
Log:
backport.pl: Follow-up to r1507640: implement basename() really correctly
(that is, don't).

* tools/dist/backport.pl
  (File::Basename::basename): Import.
  (usage, handle_entry): Use it instead of reinventing it.

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=1507643&r1=1507642&r2=1507643&view=diff
==============================================================================
--- subversion/trunk/tools/dist/backport.pl (original)
+++ subversion/trunk/tools/dist/backport.pl Sat Jul 27 13:58:01 2013
@@ -22,6 +22,7 @@ use feature qw/switch say/;
 
 use Digest ();
 use Term::ReadKey qw/ReadMode ReadKey/;
+use File::Basename qw/basename/;
 use File::Copy qw/copy move/;
 use File::Temp qw/tempfile/;
 use POSIX qw/ctermid/;
@@ -82,8 +83,7 @@ $SVNq =~ s/-q// if $DEBUG eq 'true';
 
 
 sub usage {
-  my $basename = $0;
-  $basename =~ s#.*/##;
+  my $basename = basename $0;
   print <<EOF;
 backport.pl: a tool for reviewing and merging STATUS entries.  Run this with
 CWD being the root of the stable branch (e.g., 1.8.x).  The ./STATUS file
@@ -554,7 +554,7 @@ sub handle_entry {
                                    sprintf "Conflicts on %s%s%s",
                                      '[' x !!@conflicts,
                                      (join ', ',
-                                      map m#(?:.*/)?(.*)#,
+                                      map { basename $_ }
                                       @conflicts),
                                      ']' x !!@conflicts,
                                   ];



Mime
View raw message