Author: danielsh Date: Wed Apr 24 16:23:56 2013 New Revision: 1471511 URL: http://svn.apache.org/r1471511 Log: Teach backport.pl to open an interactive subshell.
* tools/dist/backport.pl (prompt): Let the caller specify the text. (handle_entry): Open a subshell, update calls to prompt(). 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=1471511&r1=1471510&r2=1471511&view=diff ============================================================================== --- subversion/trunk/tools/dist/backport.pl (original) +++ subversion/trunk/tools/dist/backport.pl Wed Apr 24 16:23:56 2013 @@ -65,7 +65,7 @@ EOF sub prompt { local $\; # disable 'perl -l' effects - print "Go ahead? "; + print "$_[0] "; # TODO: this part was written by trial-and-error ReadMode 'cbreak'; @@ -237,7 +237,12 @@ sub handle_entry { print ""; print "Vetoes found!" if @vetoes; - merge %entry if prompt; + merge %entry if prompt 'Go ahead?'; + system($ENV{SHELL} // "/bin/sh") == 0 + or warn "Creating an interactive subshell failed ($?): $!" + if prompt "Shall I open a subshell?"; + # Don't revert. The next merge() call will do that anyway, or maybe the + # user did in his interactive shell. } # TODO: merge() changes ./STATUS, which we're reading below, but