cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1075649 - /cxf/trunk/bin/DoMerges.java
Date Tue, 01 Mar 2011 04:19:21 GMT
Author: dkulp
Date: Tue Mar  1 04:19:21 2011
New Revision: 1075649

URL: http://svn.apache.org/viewvc?rev=1075649&view=rev
Log:
Add a "Record only" option while walking through potential merges to
allow things that have already been merged to be marked as having
been merged.

Modified:
    cxf/trunk/bin/DoMerges.java

Modified: cxf/trunk/bin/DoMerges.java
URL: http://svn.apache.org/viewvc/cxf/trunk/bin/DoMerges.java?rev=1075649&r1=1075648&r2=1075649&view=diff
==============================================================================
--- cxf/trunk/bin/DoMerges.java (original)
+++ cxf/trunk/bin/DoMerges.java Tue Mar  1 04:19:21 2011
@@ -171,6 +171,7 @@ public class DoMerges {
         p.waitFor();
 
         List<String> blocks = new ArrayList<String>();
+        List<String> records = new ArrayList<String>();
 
         int count = 1;
         for (String ver : verList) {
@@ -190,8 +191,9 @@ public class DoMerges {
             char c = auto ? 'M' : 0;
             while (c != 'M'
                    && c != 'B'
-                   && c != 'I') {
-                System.out.print("[M]erge, [B]lock, or [I]gnore? ");
+                   && c != 'I'
+                   && c != 'R') {
+                System.out.print("[M]erge, [B]lock, or [I]gnore, [R]ecord only? ");
                 int i = System.in.read();
                 c = Character.toUpperCase((char)i);
             }
@@ -221,11 +223,42 @@ public class DoMerges {
             case 'B':
                 blocks.add(ver);
                 break;
+            case 'R':
+                records.add(ver);
+                break;
             case 'I':
                 System.out.println("Ignoring");
                 break;
             }
         }
+        if (!records.isEmpty()) {
+            StringBuilder ver = new StringBuilder();
+            for (String s : blocks) {
+                if (ver.length() > 0) {
+                    ver.append(',');
+                }
+                ver.append(s);
+            }
+            System.out.println("Recording " + ver);
+            p = Runtime.getRuntime().exec(getCommandLine(new String[] {"svnmerge.py", "merge",
"--record-only", "-r", ver.toString()}));
+            reader = new BufferedReader(new InputStreamReader(p.getInputStream()));
+            line = reader.readLine();
+            while (line != null) {
+                System.out.println(line);
+                line = reader.readLine();
+            }
+            if (p.waitFor() != 0) {
+                System.out.println("ERROR!");
+                reader = new BufferedReader(new InputStreamReader(p.getErrorStream()));
+                line = reader.readLine();
+                while (line != null) {
+                    System.out.println(line);
+                    line = reader.readLine();
+                }
+                System.exit(1);
+            }
+            doCommit();
+        }
 
         if (!blocks.isEmpty()) {
             StringBuilder ver = new StringBuilder();



Mime
View raw message