Merge branch 'stable-2.5'

* stable-2.5:
  Create ref for patch set that is created when a change is cherry-picked
  Add missing mail template examples to site init
  Fix: Projects created outside of Gerrit could not be cloned.
  Remove red background for outdated dependency after rebase
  Don't remove dashes from approval category name.
  Add `--is-draft` argument on patchset-created hook
  Add change topic in hook arguments
  Update the Gerrit 2.5 release notes for rc1
This commit is contained in:
Edwin Kempin
2012-10-06 07:39:51 +02:00
4 changed files with 94 additions and 2 deletions

View File

@@ -976,6 +976,17 @@ public class MergeOp {
}
}
final RefUpdate ru = repo.updateRef(ps.getRefName());
ru.setExpectedOldObjectId(ObjectId.zeroId());
ru.setNewObjectId(newCommit);
ru.disableRefLog();
if (ru.update(rw) != RefUpdate.Result.NEW) {
throw new IOException(String.format(
"Failed to create ref %s in %s: %s", ps.getRefName(),
n.change.getDest().getParentKey().get(), ru.getResult()));
}
replication.fire(n.change.getProject(), ru.getName());
newCommit.copyFrom(n);
newCommit.statusCode = CommitMergeStatus.CLEAN_PICK;
commits.put(newCommit.patchsetId.getParentKey(), newCommit);