@Override
public synchronized String merge(String branchRevisionId, String message)
throws MicroKernelException {
Revision revision = getRevision(branchRevisionId);
if (revision.branch == null) {
throw new MicroKernelException(
"Branch not found: " + branchRevisionId);
}
try {
NodeState newRoot =
store.merge(revision.branch, CONFLICT_HOOK, null);
if (!newRoot.equals(head.root)) {
head = new Revision(head, newRoot, message);
revisions.put(head.id, head);
notifyAll();
}
} catch (CommitFailedException e) {
throw new MicroKernelException(e);
}
return head.id;
}