From 289b7c60a9e232f7b37829c5aad858c7c13286b7 Mon Sep 17 00:00:00 2001 From: Christian Halstrick Date: Thu, 26 Jun 2014 13:42:21 +0200 Subject: [PATCH] Fixed message for exception thrown during recursive merge During recursive merge jgit potentially has to merge multiple common ancestors. If this fails because there are conflicts then the exception thrown for that should have a message which states this clearly. Previously a wrong message was given ("More than 200 merge bases ...") Change-Id: Ia3c058d5575decdefd50390ed83b63668d31c1d1 --- .../resources/org/eclipse/jgit/internal/JGitText.properties | 1 + .../src/org/eclipse/jgit/internal/JGitText.java | 1 + .../src/org/eclipse/jgit/merge/RecursiveMerger.java | 6 ++---- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties index fe431319f..750b65c65 100644 --- a/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties +++ b/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties @@ -311,6 +311,7 @@ mergeConflictOnNotes=Merge conflict on note {0}. base = {1}, ours = {2}, theirs mergeStrategyAlreadyExistsAsDefault=Merge strategy "{0}" already exists as a default strategy mergeStrategyDoesNotSupportHeads=merge strategy {0} does not support {1} heads to be merged into HEAD mergeUsingStrategyResultedInDescription=Merge of revisions {0} with base {1} using strategy {2} resulted in: {3}. {4} +mergeRecursiveConflictsWhenMergingCommonAncestors=Multiple common ancestors were found and merging them resulted in a conflict: {0}, {1} mergeRecursiveReturnedNoCommit=Merge returned no commit:\n Depth {0}\n Head one {1}\n Head two {2} mergeRecursiveTooManyMergeBasesFor = "More than {0} merge bases for:\n a {1}\n b {2} found:\n count {3}" messageAndTaggerNotAllowedInUnannotatedTags = Unannotated tags cannot have a message or tagger diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java index f075db3e5..ed9451492 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/JGitText.java @@ -370,6 +370,7 @@ public class JGitText extends TranslationBundle { /***/ public String mergeStrategyAlreadyExistsAsDefault; /***/ public String mergeStrategyDoesNotSupportHeads; /***/ public String mergeUsingStrategyResultedInDescription; + /***/ public String mergeRecursiveConflictsWhenMergingCommonAncestors; /***/ public String mergeRecursiveReturnedNoCommit; /***/ public String mergeRecursiveTooManyMergeBasesFor; /***/ public String messageAndTaggerNotAllowedInUnannotatedTags; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java b/org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java index cce3de9b2..885d88e5c 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/merge/RecursiveMerger.java @@ -203,10 +203,8 @@ public class RecursiveMerger extends ResolveMerger { throw new NoMergeBaseException( NoMergeBaseException.MergeBaseFailureReason.CONFLICTS_DURING_MERGE_BASE_CALCULATION, MessageFormat.format( - JGitText.get().mergeRecursiveTooManyMergeBasesFor, - Integer.valueOf(MAX_BASES), a.name(), - b.name(), - Integer.valueOf(baseCommits.size()))); + JGitText.get().mergeRecursiveConflictsWhenMergingCommonAncestors, + currentBase.getName(), nextBase.getName())); } } finally { inCore = oldIncore;