diff options
author | jmisinco | 2013-05-16 22:45:33 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2013-05-20 20:52:10 +0000 |
commit | dc90a8df1060207222e4c159e5ccb18e08eea520 (patch) | |
tree | bb8c19edd6e6c55d6d05f0f27da59fd409025f0c | |
parent | a917f2326ea4bf9ee061d508ccba092ab00461b5 (diff) | |
download | org.eclipse.osee-dc90a8df1060207222e4c159e5ccb18e08eea520.tar.gz org.eclipse.osee-dc90a8df1060207222e4c159e5ccb18e08eea520.tar.xz org.eclipse.osee-dc90a8df1060207222e4c159e5ccb18e08eea520.zip |
bug[ats_KJBRH]: Merge Manager destination diff gives misleading information
Change-Id: Ia1c27de4d367bb2e76ae88e7c77a2bcec9286fba
3 files changed, 27 insertions, 8 deletions
diff --git a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ConflictManagerInternal.java b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ConflictManagerInternal.java index a777d5e8b59..641d1646b8a 100644 --- a/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ConflictManagerInternal.java +++ b/plugins/org.eclipse.osee.framework.skynet.core/src/org/eclipse/osee/framework/skynet/core/revision/ConflictManagerInternal.java @@ -372,7 +372,7 @@ public class ConflictManagerInternal { * branches that share a common history. If two branches share the same history than the point at which they diverged * should provide the reference for detecting conflicts based on the gamma at that point. */ - private static TransactionRecord findCommonTransaction(Branch sourceBranch, Branch destBranch) throws OseeCoreException { + public static TransactionRecord findCommonTransaction(Branch sourceBranch, Branch destBranch) throws OseeCoreException { Collection<Branch> sourceBranches = sourceBranch.getAncestors(); Collection<Branch> destBranches = destBranch.getAncestors(); Branch commonBranch = null; diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/DiffHandler.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/DiffHandler.java index ebc9abed9ba..d148298ead3 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/DiffHandler.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/DiffHandler.java @@ -51,7 +51,7 @@ class DiffHandler extends AbstractSelectionEnabledHandler { attributeConflict.getSourceArtifact(), "Source_Diff_For"); break; case 2: - MergeUtility.showCompareFile(MergeUtility.getStartArtifact(attributeConflict), + MergeUtility.showCompareFile(MergeUtility.getCommonAncestor(attributeConflict), attributeConflict.getDestArtifact(), "Destination_Diff_For"); break; case 3: diff --git a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeUtility.java b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeUtility.java index c704607f0a3..1d1095cc3de 100644 --- a/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeUtility.java +++ b/plugins/org.eclipse.osee.framework.ui.skynet/src/org/eclipse/osee/framework/ui/skynet/widgets/xmerge/MergeUtility.java @@ -17,6 +17,7 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.osee.framework.core.exception.OseeCoreException; import org.eclipse.osee.framework.core.model.TransactionRecord; import org.eclipse.osee.framework.core.operation.Operations; +import org.eclipse.osee.framework.core.util.Conditions; import org.eclipse.osee.framework.help.ui.OseeHelpContext; import org.eclipse.osee.framework.logging.OseeLevel; import org.eclipse.osee.framework.logging.OseeLog; @@ -26,6 +27,7 @@ import org.eclipse.osee.framework.skynet.core.attribute.WordAttribute; import org.eclipse.osee.framework.skynet.core.change.ArtifactDelta; import org.eclipse.osee.framework.skynet.core.conflict.AttributeConflict; import org.eclipse.osee.framework.skynet.core.conflict.Conflict; +import org.eclipse.osee.framework.skynet.core.revision.ConflictManagerInternal; import org.eclipse.osee.framework.ui.plugin.util.HelpUtil; import org.eclipse.osee.framework.ui.skynet.internal.Activator; import org.eclipse.osee.framework.ui.skynet.render.PresentationType; @@ -145,16 +147,33 @@ public class MergeUtility { } public static Artifact getStartArtifact(Conflict conflict) { + Artifact toReturn = null; try { - if (conflict.getSourceBranch() == null) { - return null; + if (Conditions.notNull(conflict.getSourceBranch())) { + TransactionRecord baseTransaction = conflict.getSourceBranch().getBaseTransaction(); + toReturn = + ArtifactQuery.getHistoricalArtifactFromId(conflict.getArtifact().getGuid(), baseTransaction, + INCLUDE_DELETED); } - TransactionRecord baseTransaction = conflict.getSourceBranch().getBaseTransaction(); - return ArtifactQuery.getHistoricalArtifactFromId(conflict.getArtifact().getGuid(), baseTransaction, - INCLUDE_DELETED); } catch (OseeCoreException ex) { OseeLog.log(Activator.class, Level.SEVERE, ex); } - return null; + return toReturn; + } + + public static Artifact getCommonAncestor(Conflict conflict) { + Artifact toReturn = null; + try { + if (Conditions.notNull(conflict.getSourceBranch())) { + TransactionRecord commonTransaction = + ConflictManagerInternal.findCommonTransaction(conflict.getSourceBranch(), conflict.getDestBranch()); + toReturn = + ArtifactQuery.getHistoricalArtifactFromId(conflict.getArtifact().getGuid(), commonTransaction, + INCLUDE_DELETED); + } + } catch (OseeCoreException ex) { + OseeLog.log(Activator.class, Level.SEVERE, ex); + } + return toReturn; } }
\ No newline at end of file |