Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2011-08-26 00:13:29 -0400
committerEike Stepper2011-08-26 00:13:29 -0400
commitb1d179afa361ef7ecac47f2b606b8c03f309a32f (patch)
tree4c53fabfdbc71541fc848f7fc91dd50cf171ec71
parent34a7c0d41008e82a8947413edbf6b0fcf97d0943 (diff)
downloadcdo-b1d179afa361ef7ecac47f2b606b8c03f309a32f.tar.gz
cdo-b1d179afa361ef7ecac47f2b606b8c03f309a32f.tar.xz
cdo-b1d179afa361ef7ecac47f2b606b8c03f309a32f.zip
workspace.checkin() must use the versions of the base revisions
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/CDOWorkspaceImpl.java2
2 files changed, 21 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java
index 0edfcad8d3..f62663af3a 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java
@@ -222,6 +222,15 @@ public final class CDORevisionUtil
public static CDOChangeSetData createChangeSetData(Set<CDOID> ids, CDORevisionProvider startProvider,
CDORevisionProvider endProvider)
{
+ return createChangeSetData(ids, startProvider, endProvider, false);
+ }
+
+ /**
+ * @since 4.1
+ */
+ public static CDOChangeSetData createChangeSetData(Set<CDOID> ids, CDORevisionProvider startProvider,
+ CDORevisionProvider endProvider, boolean useStartVersions)
+ {
List<CDOIDAndVersion> newObjects = new ArrayList<CDOIDAndVersion>();
List<CDORevisionKey> changedObjects = new ArrayList<CDORevisionKey>();
List<CDOIDAndVersion> detachedObjects = new ArrayList<CDOIDAndVersion>();
@@ -232,9 +241,14 @@ public final class CDORevisionUtil
if (startRevision == null && endRevision != null)
{
+ if (useStartVersions)
+ {
+ ((InternalCDORevision)endRevision).setVersion(0);
+ }
+
newObjects.add(endRevision);
}
- else if (endRevision == null && startRevision != null)
+ else if (startRevision != null && endRevision == null)
{
detachedObjects.add(CDOIDUtil.createIDAndVersion(id, CDOBranchVersion.UNSPECIFIED_VERSION));
}
@@ -242,6 +256,11 @@ public final class CDORevisionUtil
{
if (!startRevision.equals(endRevision))
{
+ if (useStartVersions)
+ {
+ ((InternalCDORevision)endRevision).setVersion(startRevision.getVersion());
+ }
+
CDORevisionDelta delta = endRevision.compare(startRevision);
if (!delta.isEmpty())
{
diff --git a/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/CDOWorkspaceImpl.java b/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/CDOWorkspaceImpl.java
index aea0f1b6c6..517e724b1d 100644
--- a/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/CDOWorkspaceImpl.java
+++ b/plugins/org.eclipse.emf.cdo.workspace/src/org/eclipse/emf/cdo/internal/workspace/CDOWorkspaceImpl.java
@@ -582,7 +582,7 @@ public class CDOWorkspaceImpl extends Notifier implements InternalCDOWorkspace
public CDOChangeSetData getLocalChanges()
{
Set<CDOID> ids = base.getIDs();
- return CDORevisionUtil.createChangeSetData(ids, base, this);
+ return CDORevisionUtil.createChangeSetData(ids, base, this, true);
}
public CDOSessionConfigurationFactory getRemoteSessionConfigurationFactory()

Back to the top