public CDORevisableImpl(CDORevisable source) { super(source.getBranch(), source.getVersion()); timeStamp = source.getTimeStamp(); revised = source.getRevised(); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (obj instanceof CDORevisable) { CDORevisable that = (CDORevisable)obj; return timeStamp == that.getTimeStamp() && revised == that.getRevised() && getBranch().equals(that.getBranch()) && getVersion() == that.getVersion(); } return false; }
private int getNewVersion(CDORevisionKey key) { if (key instanceof CDORevisionDelta) { CDORevisionDelta delta = (CDORevisionDelta)key; CDORevisable target = delta.getTarget(); if (target != null && key.getBranch() == target.getBranch()) { return target.getVersion(); } } return key.getVersion() + 1; } }
private int getNewVersion(CDORevisionKey key) { if (key instanceof CDORevisionDelta) { CDORevisionDelta delta = (CDORevisionDelta)key; CDORevisable target = delta.getTarget(); if (target != null && key.getBranch() == target.getBranch()) { return target.getVersion(); } } return key.getVersion() + 1; } }
public void writeCDORevisable(CDORevisable revisable) throws IOException { writeCDOBranch(revisable.getBranch()); writeInt(revisable.getVersion()); writeLong(revisable.getTimeStamp()); writeLong(revisable.getRevised()); }
private Pair<InternalCDORevision, InternalCDORevision> createNewRevision(CDORevisionKey potentialDelta, CDOCommitInfo commitInfo) { if (potentialDelta instanceof CDORevisionDelta) { CDORevisionDelta delta = (CDORevisionDelta)potentialDelta; CDOID id = delta.getID(); InternalCDORevisionManager revisionManager = getRevisionManager(); InternalCDORevision oldRevision = revisionManager.getRevisionByVersion(id, potentialDelta, CDORevision.UNCHUNKED, false); if (oldRevision != null) { InternalCDORevision newRevision = oldRevision.copy(); newRevision.adjustForCommit(commitInfo.getBranch(), commitInfo.getTimeStamp()); CDORevisable target = delta.getTarget(); if (target != null) { newRevision.setVersion(target.getVersion()); } delta.apply(newRevision); newRevision.freeze(); return new Pair<InternalCDORevision, InternalCDORevision>(oldRevision, newRevision); } } return null; }
if (target != null) newRevision.setVersion(target.getVersion());