Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2016-10-10 09:53:52 -0400
committerEike Stepper2016-10-10 09:53:52 -0400
commitc15fd3efd477d5336cde2ef3eee6cd40c58f59c2 (patch)
tree0816294b4795d2cb27ea31d9ee0f2f85d3b0e947 /plugins/org.eclipse.emf.cdo.server.net4j
parentda400648e8fe23899619769629dabc8123490e96 (diff)
downloadcdo-c15fd3efd477d5336cde2ef3eee6cd40c58f59c2.tar.gz
cdo-c15fd3efd477d5336cde2ef3eee6cd40c58f59c2.tar.xz
cdo-c15fd3efd477d5336cde2ef3eee6cd40c58f59c2.zip
[505654] Support automatic remerging / multiple merges from the same branch
https://bugs.eclipse.org/bugs/show_bug.cgi?id=505654
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.server.net4j')
-rw-r--r--plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadMergeDataIndication.java65
1 files changed, 47 insertions, 18 deletions
diff --git a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadMergeDataIndication.java b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadMergeDataIndication.java
index ac206016f6..ff6eaf4c69 100644
--- a/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadMergeDataIndication.java
+++ b/plugins/org.eclipse.emf.cdo.server.net4j/src/org/eclipse/emf/cdo/server/internal/net4j/protocol/LoadMergeDataIndication.java
@@ -18,6 +18,7 @@ import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionKey;
import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
+import org.eclipse.emf.cdo.spi.common.branch.CDOBranchUtil;
import org.eclipse.emf.cdo.spi.common.commit.CDORevisionAvailabilityInfo;
import org.eclipse.emf.cdo.spi.server.InternalRepository;
@@ -34,8 +35,6 @@ import java.util.Set;
*/
public class LoadMergeDataIndication extends CDOServerReadIndicationWithMonitoring
{
- private int infos;
-
private CDORevisionAvailabilityInfo targetInfo;
private CDORevisionAvailabilityInfo sourceInfo;
@@ -44,6 +43,10 @@ public class LoadMergeDataIndication extends CDOServerReadIndicationWithMonitori
private CDORevisionAvailabilityInfo sourceBaseInfo;
+ private int infos;
+
+ private boolean auto;
+
public LoadMergeDataIndication(CDOServerProtocol protocol)
{
super(protocol, CDOProtocolConstants.SIGNAL_LOAD_MERGE_DATA);
@@ -85,27 +88,33 @@ public class LoadMergeDataIndication extends CDOServerReadIndicationWithMonitori
private CDORevisionAvailabilityInfo readRevisionAvailabilityInfo(CDODataInput in, OMMonitor monitor)
throws IOException
{
- CDOBranchPoint branchPoint = in.readCDOBranchPoint();
- CDORevisionAvailabilityInfo info = new CDORevisionAvailabilityInfo(branchPoint);
+ if (in.readBoolean())
+ {
+ CDOBranchPoint branchPoint = in.readCDOBranchPoint();
+ CDORevisionAvailabilityInfo info = new CDORevisionAvailabilityInfo(branchPoint);
- int size = in.readInt();
- monitor.begin(size);
+ int size = in.readInt();
+ monitor.begin(size);
- try
- {
- for (int i = 0; i < size; i++)
+ try
{
- CDOID id = in.readCDOID();
- info.getAvailableRevisions().put(id, null);
- monitor.worked();
- }
+ for (int i = 0; i < size; i++)
+ {
+ CDOID id = in.readCDOID();
+ info.getAvailableRevisions().put(id, null);
+ monitor.worked();
+ }
- return info;
- }
- finally
- {
- monitor.done();
+ return info;
+ }
+ finally
+ {
+ monitor.done();
+ }
}
+
+ auto = true;
+ return new CDORevisionAvailabilityInfo(CDOBranchUtil.AUTO_BRANCH_POINT);
}
@Override
@@ -115,6 +124,11 @@ public class LoadMergeDataIndication extends CDOServerReadIndicationWithMonitori
try
{
+ // if (auto)
+ // {
+ // sourceBaseInfo = new CDORevisionAvailabilityInfo(CDOBranchUtil.AUTO_BRANCH_POINT);
+ // }
+
InternalRepository repository = getRepository();
Set<CDOID> ids = repository.getMergeData(targetInfo, sourceInfo, targetBaseInfo, sourceBaseInfo, monitor.fork());
@@ -126,6 +140,21 @@ public class LoadMergeDataIndication extends CDOServerReadIndicationWithMonitori
monitor.worked();
+ if (auto)
+ {
+ out.writeCDOBranchPoint(targetBaseInfo.getBranchPoint());
+ if (targetBaseInfo.getBranchPoint().equals(sourceBaseInfo.getBranchPoint()))
+ {
+ out.writeBoolean(false);
+ infos = 3;
+ }
+ else
+ {
+ out.writeBoolean(true);
+ out.writeCDOBranchPoint(sourceBaseInfo.getBranchPoint());
+ }
+ }
+
Set<CDORevisionKey> writtenRevisions = new HashSet<CDORevisionKey>();
writeRevisionAvailabilityInfo(out, targetInfo, writtenRevisions, monitor.fork());
writeRevisionAvailabilityInfo(out, sourceInfo, writtenRevisions, monitor.fork());

Back to the top