Author: danielsh
Date: Fri Aug  2 12:12:04 2013
New Revision: 1509649

URL: http://svn.apache.org/r1509649
Log:
backport.pl: guard against ambiguous --accept specifications.

* tools/dist/backport.pl
  (parse_entry): Detect multiple --accept specifications, warn about them,
    and ignore the conflicting values (so that the merge, later on, will
    conflict).

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=1509649&r1=1509648&r2=1509649&view=diff
==============================================================================
--- subversion/trunk/tools/dist/backport.pl (original)
+++ subversion/trunk/tools/dist/backport.pl Fri Aug  2 12:12:04 2013
@@ -329,7 +329,16 @@ sub parse_entry {
       if (s/^Notes:\s*//) {
         my $notes = $_;
         $notes .= shift while @_ and $_[0] !~ /^\w/;
-        $accept = $1 if $notes =~ /--accept[ =]([a-z-]+)/;
+        my %accepts = map { $_ => 1 } ($notes =~ /--accept[ =]([a-z-]+)/g);
+        given (scalar keys %accepts) {
+          when (0) { } 
+          when (1) { $accept = [keys %accepts]->[0]; } 
+          default  {
+            warn "Too many --accept values at '",
+                 logsummarysummary({ logsummary => [@logsummary] }),
+                 "'";
+          }
+        }
       }
     }
   }


Reply via email to