subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1499093 - /subversion/trunk/tools/dist/backport.pl
Date Tue, 02 Jul 2013 20:14:16 GMT
Author: danielsh
Date: Tue Jul  2 20:14:15 2013
New Revision: 1499093

URL: http://svn.apache.org/r1499093
Log:
backport.pl: handle SIGINT (^C).

* tools/dist/backport.pl
  (maybe_revert): New helper.
  (main): Break out the last part into the helper, and install it as a signal
    handler, too.

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=1499093&r1=1499092&r2=1499093&view=diff
==============================================================================
--- subversion/trunk/tools/dist/backport.pl (original)
+++ subversion/trunk/tools/dist/backport.pl Tue Jul  2 20:14:15 2013
@@ -273,6 +273,12 @@ sub handle_entry {
   1;
 }
 
+sub maybe_revert {
+  "This is both a SIGINT handler, and the tail end of main() in normal runs.";
+  system $SVN, qw/revert -R ./ if !$YES and prompt 'Revert? ';
+  exit if @_;
+}
+
 sub main {
   usage, exit 0 if @ARGV;
 
@@ -294,6 +300,8 @@ sub main {
   }
   $/ = ""; # paragraph mode
 
+  $SIG{INT} = \&maybe_revert;
+
   my $in_approved = 0;
   while (<STATUS>) {
     my @lines = split /\n/;
@@ -324,7 +332,7 @@ sub main {
     }
   }
 
-  system $SVN, qw/revert -R ./ if !$YES and prompt 'Revert? ';
+  maybe_revert;
 }
 
 &main



Mime
View raw message