subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1515149 - /subversion/trunk/tools/dist/backport.pl
Date Sun, 18 Aug 2013 15:49:23 GMT
Author: danielsh
Date: Sun Aug 18 15:49:23 2013
New Revision: 1515149

URL: http://svn.apache.org/r1515149
Log:
nominate.pl/backport.pl: When invoked via a symlink called 'n' or 'b' respectively, cd to
the directory the symlink resides in.

This allows me to run '../18x/n 1515141. foobar' from a trunk working copy.

* tools/dist/backport.pl
  (File::Basename::dirname): Import.
  (backport_usage, nominate_usage): Document.
  (): When $0 is "b" or "n", use the directory of $0 (probably a symlink).

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=1515149&r1=1515148&r2=1515149&view=diff
==============================================================================
--- subversion/trunk/tools/dist/backport.pl (original)
+++ subversion/trunk/tools/dist/backport.pl Sun Aug 18 15:49:23 2013
@@ -22,7 +22,7 @@ use feature qw/switch say/;
 
 use Digest ();
 use Term::ReadKey qw/ReadMode ReadKey/;
-use File::Basename qw/basename/;
+use File::Basename qw/basename dirname/;
 use File::Copy qw/copy move/;
 use File::Temp qw/tempfile/;
 use POSIX qw/ctermid strftime/;
@@ -93,8 +93,9 @@ backport.pl: a tool for reviewing and me
 CWD being the root of the stable branch (e.g., 1.8.x).  The ./STATUS file
 should be at HEAD.
 
-Usage: [ -e \$d/STATUS ] && cd \$d && backport.pl
-Usage: [ -e \$d/STATUS ] && cd \$d && backport.pl pattern
+Usage: test -e \$d/STATUS && cd \$d && backport.pl [PATTERN]
+Usage: ln -s /path/to/backport.pl \$d/b && \$d/b [PATTERN]
+(where \$d is a working copy of branches/1.8.x)
 
 If PATTERN is provided, only entries which match PATTERN are considered.  The
 sense of "match" is either substring (fgrep) or Perl regexp (with /msi).
@@ -145,6 +146,10 @@ nominate.pl: a tool for adding entries t
 
 Usage: $0 "r42,r43,45." "\$Some_justification"
 
+The STATUS file in the current directory is used, unless argv[0] is "n", in
+which case the STATUS file in the directory of argv[0] is used.  The intent
+is to create a symlink named "n" in the branch wc root.
+
 Will add:
  * r42, r43, r45
    (log message of r42)
@@ -940,9 +945,11 @@ sub nominate_main {
 # Dispatch to the appropriate main().
 given (basename($0)) {
   when (/^b$|backport/) {
+    chdir dirname $0 if /^b$/ or die "Can't chdir: $!";
     &backport_main(@ARGV);
   }
   when (/^n$|nominate/) {
+    chdir dirname $0 if /^n$/ or die "Can't chdir: $!";
     &nominate_main(@ARGV);
   }
   default {



Mime
View raw message