Repository: cxf Updated Branches: refs/heads/master 621622e3b -> 816ab4c9c
Print all the possible matching commits at once and ask once instead of being asked a dozen times for things like "Fix Compile Failure" and other generic messages Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/816ab4c9 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/816ab4c9 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/816ab4c9 Branch: refs/heads/master Commit: 816ab4c9c619826b53c3da8c8dc6b05609c80e68 Parents: 621622e Author: Daniel Kulp <[email protected]> Authored: Fri Apr 4 12:12:02 2014 -0400 Committer: Daniel Kulp <[email protected]> Committed: Fri Apr 4 12:12:44 2014 -0400 ---------------------------------------------------------------------- bin/DoMerges.java | 57 ++++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 25 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/816ab4c9/bin/DoMerges.java ---------------------------------------------------------------------- diff --git a/bin/DoMerges.java b/bin/DoMerges.java index 17e5f97..f6fd9d0 100644 --- a/bin/DoMerges.java +++ b/bin/DoMerges.java @@ -546,14 +546,41 @@ public class DoMerges { if (gitLogs == null) { return false; } + List<List<String>> matchingLogs = new LinkedList<List<String>>(); for (String[] f : gitLogs) { - if (compareLogs(f, logLines)) { + List<String> ll = compareLogs(f, logLines); + if (!ll.isEmpty()) { + matchingLogs.add(ll); + } + } + + if (!matchingLogs.isEmpty()) { + //everything in the source log is in a log on this branch, let's prompt to record the merge + System.out.println("Found possible commit(s) already on branch:"); + for (List<String> f : matchingLogs) { + for (String s : f) { + System.out.println(" " + s); + } + System.out.println("------------------------"); + } + + while (System.in.available() > 0) { + System.in.read(); + } + char c = 0; + while (c != 'Y' + && c != 'N') { + System.out.print("Record as merged [Y/N]? "); + int i = System.in.read(); + c = Character.toUpperCase((char)i); + } + if (c == 'Y') { return true; } } return false; - } - private static boolean compareLogs(String[] f, String[] logLines) throws IOException { + } + private static List<String> compareLogs(String[] f, String[] logLines) throws IOException { ArrayList<String> onBranch = new ArrayList<String>(f.length); for (String s : f) { if (s.trim().startsWith("Conflicts:")) { @@ -575,29 +602,9 @@ public class DoMerges { ll.add(s); } } - if (ll.isEmpty()) { - //everything in the source log is in a log on this branch, let's prompt to record the merge - System.out.println("Found possible commit already on branch:"); - for (String s : f) { - System.out.println(s); - } - - while (System.in.available() > 0) { - System.in.read(); - } - char c = 0; - while (c != 'Y' - && c != 'N') { - System.out.print("Record as merged [Y/N]? "); - int i = System.in.read(); - c = Character.toUpperCase((char)i); - } - if (c == 'Y') { - return true; - } - } - return false; + return ll; } + private static String[] getCommandLine(String[] args) { List<String> argLine = new ArrayList<String>();
