Source:
InternalBranch rebase(InternalBranch branch, InternalBranch onTopOf, String commitMessage, Runnable postReopen) { CDOTransaction testTransaction = null; CDOTransaction newTransaction = null; try { if (branch.headTimestamp() > branch.baseTimestamp()) { testTransaction = applyChangeSet(branch, onTopOf, true); final InternalCDOBasedBranch tmpBranch = (InternalCDOBasedBranch) reopen(onTopOf, String.format(TEMP_BRANCH_NAME_FORMAT, Branch.TEMP_PREFIX, branch.name(), System.currentTimeMillis()), branch.metadata()); postReopen.run(); newTransaction = transferChangeSet(testTransaction, tmpBranch); final InternalCDOBasedBranch tmpBranchWithChanges = (InternalCDOBasedBranch) commitChanges(branch, tmpBranch, commitMessage, newTransaction); final CDOBranchImpl rebasedBranch = new CDOBranchImpl(branch.name(), branch.parentPath(), tmpBranchWithChanges.baseTimestamp(), tmpBranchWithChanges.headTimestamp(), branch.metadata(), tmpBranchWithChanges.cdoBranchId(), tmpBranchWithChanges.segmentId(), tmpBranchWithChanges.segments(), tmpBranchWithChanges.parentSegments()); final IndexWrite<Void> replace = prepareReplace(branch.getClass(), branch.path(), rebasedBranch); final CDOBranch rebasedCDOBranch = getCDOBranch(rebasedBranch); rebasedCDOBranch.rename(branch.name()); commit(replace); sendChangeEvent(branch.path()); return rebasedBranch; } else { final InternalBranch rebasedBranch = reopen(onTopOf, branch.name(), branch.metadata()); postReopen.run(); sendChangeEvent(rebasedBranch.path()); return rebasedBranch; } } finally { LifecycleUtil.deactivate(testTransaction); LifecycleUtil.deactivate(newTransaction); } }

Target:
InternalBranch rebase(InternalBranch branch, InternalBranch onTopOf, String commitMessage, Runnable postReopen) { CDOTransaction testTransaction = null; CDOTransaction newTransaction = null; try { if (branch.headTimestamp() > branch.baseTimestamp()) { testTransaction = applyChangeSet(branch, onTopOf, true); final InternalCDOBasedBranch tmpBranch = (InternalCDOBasedBranch) reopen(onTopOf, String.format(Branch.TEMP_BRANCH_NAME_FORMAT, Branch.TEMP_PREFIX, branch.name(), System.currentTimeMillis()), branch.metadata()); postReopen.run(); newTransaction = transferChangeSet(testTransaction, tmpBranch); final InternalCDOBasedBranch tmpBranchWithChanges = (InternalCDOBasedBranch) commitChanges(branch, tmpBranch, commitMessage, newTransaction); final CDOBranchImpl rebasedBranch = new CDOBranchImpl(branch.name(), onTopOf.path(), tmpBranchWithChanges.baseTimestamp(), tmpBranchWithChanges.headTimestamp(), branch.metadata(), tmpBranchWithChanges.cdoBranchId(), tmpBranchWithChanges.segmentId(), tmpBranchWithChanges.segments(), tmpBranchWithChanges.parentSegments()); final IndexWrite<Void> replace = prepareReplace(branch.getClass(), branch.path(), rebasedBranch); final CDOBranch rebasedCDOBranch = getCDOBranch(rebasedBranch); rebasedCDOBranch.rename(branch.name()); commit(replace); sendChangeEvent(branch.path()); return rebasedBranch; } else { final InternalBranch rebasedBranch = reopen(onTopOf, branch.name(), branch.metadata()); postReopen.run(); sendChangeEvent(rebasedBranch.path()); return rebasedBranch; } } finally { LifecycleUtil.deactivate(testTransaction); LifecycleUtil.deactivate(newTransaction); } }