diff options
author | Andre Weinand | 2003-02-13 16:50:36 +0000 |
---|---|---|
committer | Andre Weinand | 2003-02-13 16:50:36 +0000 |
commit | 8ff37f4faae15077a7c2777c8f44bb8a5ed628a9 (patch) | |
tree | 45770b328c2809c1508176c7ffbd2e50dc54e859 | |
parent | ed8a0b968b4bfc64469810b3caaaaf844c9414bb (diff) | |
download | eclipse.platform.team-8ff37f4faae15077a7c2777c8f44bb8a5ed628a9.tar.gz eclipse.platform.team-8ff37f4faae15077a7c2777c8f44bb8a5ed628a9.tar.xz eclipse.platform.team-8ff37f4faae15077a7c2777c8f44bb8a5ed628a9.zip |
fixed #5323
4 files changed, 46 insertions, 22 deletions
diff --git a/bundles/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/buildnotes_compare.html index 4198dc1e5..7fc5beea1 100644 --- a/bundles/org.eclipse.compare/buildnotes_compare.html +++ b/bundles/org.eclipse.compare/buildnotes_compare.html @@ -11,6 +11,14 @@ <h1> Eclipse Platform Build Notes<br> Compare</h1> +Eclipse Build Input February 18th 2003 + +<h2> +Problem reports fixed</h2> +<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=5323">#5323</a>: Compare does not handle correctly conflicts at same location<br> + +<h1> +<hr WIDTH="100%"></h1> Eclipse Build Input February 13th 2003 <h2> diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java index c8842f75d..8a4a9b15f 100644 --- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java +++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java @@ -150,6 +150,8 @@ public class TextMergeViewer extends ContentMergeViewer { private static final int BIRDS_EYE_VIEW_INSET= 1; /** */ private static final int RESOLVE_SIZE= 5; + /** if true copying conflicts from one side to other concatenates both sides */ + private static final boolean APPEND_CONFLICT= true; /** line width of change borders */ private static final int LW= 1; @@ -1247,7 +1249,7 @@ public class TextMergeViewer extends ContentMergeViewer { fCenterButton.setVisible(false); if (fButtonDiff != null) { setCurrentDiff(fButtonDiff, false); - copy(fCurrentDiff, false, fCurrentDiff.fDirection == RangeDifference.CONFLICT, false); + copy(fCurrentDiff, false, fCurrentDiff.fDirection == RangeDifference.CONFLICT); } } } @@ -3683,7 +3685,7 @@ public class TextMergeViewer extends ContentMergeViewer { target.beginCompoundChange(); compoundChangeStarted= true; } - copy(diff, leftToRight, false); + copy(diff, leftToRight); } break; case RangeDifference.RIGHT: @@ -3692,7 +3694,7 @@ public class TextMergeViewer extends ContentMergeViewer { target.beginCompoundChange(); compoundChangeStarted= true; } - copy(diff, leftToRight, false); + copy(diff, leftToRight); } break; default: @@ -3755,18 +3757,18 @@ public class TextMergeViewer extends ContentMergeViewer { } private void copyDiffLeftToRight() { - copy(fCurrentDiff, true, false, false); + copy(fCurrentDiff, true, false); } private void copyDiffRightToLeft() { - copy(fCurrentDiff, false, false, false); + copy(fCurrentDiff, false, false); } /* * Copy the contents of the given diff from one side to the other. */ - private void copy(Diff diff, boolean leftToRight, boolean both, boolean gotoNext) { - if (copy(diff, leftToRight, both)) { + private void copy(Diff diff, boolean leftToRight, boolean gotoNext) { + if (copy(diff, leftToRight)) { if (gotoNext) { navigate(true, true, true); } else { @@ -3781,7 +3783,7 @@ public class TextMergeViewer extends ContentMergeViewer { * doesn't reveal anything. * Returns true if copy was succesful. */ - private boolean copy(Diff diff, boolean leftToRight, boolean both) { + private boolean copy(Diff diff, boolean leftToRight) { if (diff != null && !diff.isResolved()) { @@ -3823,9 +3825,11 @@ public class TextMergeViewer extends ContentMergeViewer { case RangeDifference.ANCESTOR: break; case RangeDifference.CONFLICT: - s= fromDoc.get(fromStart, fromLen); - if (both) - s+= toDoc.get(toStart, toLen); + if (APPEND_CONFLICT) { + s= toDoc.get(toStart, toLen); + s+= fromDoc.get(fromStart, fromLen); + } else + s= fromDoc.get(fromStart, fromLen); break; } if (s != null) { diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html index 4198dc1e5..7fc5beea1 100644 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html @@ -11,6 +11,14 @@ <h1> Eclipse Platform Build Notes<br> Compare</h1> +Eclipse Build Input February 18th 2003 + +<h2> +Problem reports fixed</h2> +<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=5323">#5323</a>: Compare does not handle correctly conflicts at same location<br> + +<h1> +<hr WIDTH="100%"></h1> Eclipse Build Input February 13th 2003 <h2> diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java index c8842f75d..8a4a9b15f 100644 --- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java +++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java @@ -150,6 +150,8 @@ public class TextMergeViewer extends ContentMergeViewer { private static final int BIRDS_EYE_VIEW_INSET= 1; /** */ private static final int RESOLVE_SIZE= 5; + /** if true copying conflicts from one side to other concatenates both sides */ + private static final boolean APPEND_CONFLICT= true; /** line width of change borders */ private static final int LW= 1; @@ -1247,7 +1249,7 @@ public class TextMergeViewer extends ContentMergeViewer { fCenterButton.setVisible(false); if (fButtonDiff != null) { setCurrentDiff(fButtonDiff, false); - copy(fCurrentDiff, false, fCurrentDiff.fDirection == RangeDifference.CONFLICT, false); + copy(fCurrentDiff, false, fCurrentDiff.fDirection == RangeDifference.CONFLICT); } } } @@ -3683,7 +3685,7 @@ public class TextMergeViewer extends ContentMergeViewer { target.beginCompoundChange(); compoundChangeStarted= true; } - copy(diff, leftToRight, false); + copy(diff, leftToRight); } break; case RangeDifference.RIGHT: @@ -3692,7 +3694,7 @@ public class TextMergeViewer extends ContentMergeViewer { target.beginCompoundChange(); compoundChangeStarted= true; } - copy(diff, leftToRight, false); + copy(diff, leftToRight); } break; default: @@ -3755,18 +3757,18 @@ public class TextMergeViewer extends ContentMergeViewer { } private void copyDiffLeftToRight() { - copy(fCurrentDiff, true, false, false); + copy(fCurrentDiff, true, false); } private void copyDiffRightToLeft() { - copy(fCurrentDiff, false, false, false); + copy(fCurrentDiff, false, false); } /* * Copy the contents of the given diff from one side to the other. */ - private void copy(Diff diff, boolean leftToRight, boolean both, boolean gotoNext) { - if (copy(diff, leftToRight, both)) { + private void copy(Diff diff, boolean leftToRight, boolean gotoNext) { + if (copy(diff, leftToRight)) { if (gotoNext) { navigate(true, true, true); } else { @@ -3781,7 +3783,7 @@ public class TextMergeViewer extends ContentMergeViewer { * doesn't reveal anything. * Returns true if copy was succesful. */ - private boolean copy(Diff diff, boolean leftToRight, boolean both) { + private boolean copy(Diff diff, boolean leftToRight) { if (diff != null && !diff.isResolved()) { @@ -3823,9 +3825,11 @@ public class TextMergeViewer extends ContentMergeViewer { case RangeDifference.ANCESTOR: break; case RangeDifference.CONFLICT: - s= fromDoc.get(fromStart, fromLen); - if (both) - s+= toDoc.get(toStart, toLen); + if (APPEND_CONFLICT) { + s= toDoc.get(toStart, toLen); + s+= fromDoc.get(fromStart, fromLen); + } else + s= fromDoc.get(fromStart, fromLen); break; } if (s != null) { |