summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2010-02-01 00:00:44 (EST)
committerCaspar De Groot2010-02-01 00:00:44 (EST)
commit07365b12b214ab5b37912e7201807affac2b56ec (patch)
tree7bd2413f575738866736aaac87eda69f6b729684
parent0fb721dc1dec753b0d7192708f8d48bf384d9ea2 (diff)
downloadcdo-07365b12b214ab5b37912e7201807affac2b56ec.zip
cdo-07365b12b214ab5b37912e7201807affac2b56ec.tar.gz
cdo-07365b12b214ab5b37912e7201807affac2b56ec.tar.bz2
[270716] Provide support for branching
https://bugs.eclipse.org/bugs/show_bug.cgi?id=270716
-rw-r--r--plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitNotificationIndication.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_CDOTest.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java33
3 files changed, 12 insertions, 29 deletions
diff --git a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitNotificationIndication.java b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitNotificationIndication.java
index 4d5bf1c..0c913f8 100644
--- a/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitNotificationIndication.java
+++ b/plugins/org.eclipse.emf.cdo.net4j/src/org/eclipse/emf/cdo/internal/net4j/protocol/CommitNotificationIndication.java
@@ -49,6 +49,10 @@ public class CommitNotificationIndication extends CDOClientIndication
protected void indicating(CDODataInput in) throws IOException
{
CDOBranchPoint branchPoint = in.readCDOBranchPoint();
+ if (TRACER.isEnabled())
+ {
+ TRACER.format("Read branchpoint: {0}", branchPoint); //$NON-NLS-1$
+ }
CDOPackageUnit[] packageUnits = in.readCDOPackageUnits(null);
InternalCDOPackageRegistry packageRegistry = getSession().getPackageRegistry();
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_CDOTest.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_CDOTest.java
index 56dff6a..409ae2b 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_CDOTest.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_283985_CDOTest.java
@@ -248,7 +248,7 @@ public class Bugzilla_283985_CDOTest extends AbstractCDOTest
int versionAfter = CDOUtil.getCDOObject(detail).cdoRevision().getVersion();
int versionBefore = versionsBefore[i];
- assertEquals(versionBefore + 1, versionAfter);
+ assertEquals(versionBefore, versionAfter);
i++;
}
@@ -363,7 +363,7 @@ public class Bugzilla_283985_CDOTest extends AbstractCDOTest
tx.commit();
order2.getOrderDetails().remove(detail1);
- assertTrue((CDOUtil.getCDOObject(detail1)).cdoState() == CDOState.TRANSIENT);
+ assertTrue(CDOUtil.getCDOObject(detail1).cdoState() == CDOState.TRANSIENT);
boolean contains;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
index 6c590e2..c7b87b2 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStateMachine.java
@@ -756,33 +756,12 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
object.cdoInternalSetID(id);
object.cdoInternalSetView(transaction);
- // Construct a new revision if the old one is not transactional
- InternalCDORevision revision;
- EClass eClass = object.eClass();
- // if (!formerRevision.isTransactional())
- // {
- // CDORevisionFactory factory = revisionManager.getFactory();
- // revision = (InternalCDORevision)factory.createRevision(eClass);
- // revision.setID(id);
- // revision.setBranchPoint(transaction.getBranch().getHead());
- // revision.setVersion(formerRevision.getVersion());
- // }
- // else
- {
- // This branch only gets taken if the object that is being re-attached,
- // was already DIRTY when it was first detached. In this case, the revision
- // is already transactional; we clear it before repopulating it.
-
- revision = formerRevision;
- for (int i = 0; i < eClass.getFeatureCount(); i++)
- {
- EStructuralFeature eFeature = object.cdoInternalDynamicFeature(i);
- if (!eFeature.isTransient())
- {
- revision.clear(eFeature);
- }
- }
- }
+ // Construct a new revision
+ CDORevisionFactory factory = revisionManager.getFactory();
+ InternalCDORevision revision = (InternalCDORevision)factory.createRevision(object.eClass());
+ revision.setID(id);
+ revision.setBranchPoint(transaction.getBranch().getHead());
+ revision.setVersion(formerRevision.getVersion());
// Populate the revision based on the values in the CDOObject
object.cdoInternalSetRevision(revision);