// graft has actually made a new changeset,
// but
// there is actually flag conflict or
// keep/delete
// conflict. So rollback the changeset.
Changeset rollbackChangeset = repo.tip();
if (!changeset.getNode().equals(rollbackChangeset.getExtra().getString("source"))) {
throw new IllegalStateException("Current tip is not grafted from expected changeset");
}
RollbackCommand.on(repo).execute();
ctx.setRollbackChangeset(rollbackChangeset);