Merge branch 'stable-2.8'

* stable-2.8:
  Fix cherry pick of multiple changes
  Fix typos in 2.8.2 release notes

Conflicts:
	gerrit-server/src/main/java/com/google/gerrit/server/git/strategy/CherryPick.java

Change-Id: Ib12351af322e8934f17909a56181e8953977c840
This commit is contained in:
Shawn Pearce
2014-03-13 17:56:33 -07:00
2 changed files with 14 additions and 15 deletions

View File

@@ -63,7 +63,7 @@ that were set to a URL.
If HEAD was detached the `GetHead` REST endpoint refused to resolve HEAD If HEAD was detached the `GetHead` REST endpoint refused to resolve HEAD
when the user was not a project owner. when the user was not a project owner.
* link:https://code.google.com/p/gerrit/issues/detail?id=2932[Issue 2932]: * link:https://code.google.com/p/gerrit/issues/detail?id=2392[Issue 2392]:
Keep `status:closed` limit below MySQL Connector/J's hard limit. Keep `status:closed` limit below MySQL Connector/J's hard limit.
+ +
Since MySQL Connector/J 5.1.21 does not allow limits above 50M rows Since MySQL Connector/J 5.1.21 does not allow limits above 50M rows
@@ -96,7 +96,7 @@ Fix submit rule evaluation for non blocking labels.
Putting a negative score on a label configured as `NoBlock` was causing Putting a negative score on a label configured as `NoBlock` was causing
the submit button to be disabled. the submit button to be disabled.
* link:https://code.google.com/p/gerrit/issues/detail?id=2331[Issue 2331]: * link:https://code.google.com/p/gerrit/issues/detail?id=2441[Issue 2441]:
Allow to create branch with new commits. Allow to create branch with new commits.
+ +
Branches could not be created with a new commit which is not on other branches Branches could not be created with a new commit which is not on other branches

View File

@@ -60,18 +60,17 @@ public class CherryPick extends SubmitStrategy {
} }
@Override @Override
protected CodeReviewCommit _run(final CodeReviewCommit mergeTip, protected CodeReviewCommit _run(CodeReviewCommit mergeTip,
final List<CodeReviewCommit> toMerge) throws MergeException { final List<CodeReviewCommit> toMerge) throws MergeException {
CodeReviewCommit newMergeTip = mergeTip;
while (!toMerge.isEmpty()) { while (!toMerge.isEmpty()) {
final CodeReviewCommit n = toMerge.remove(0); final CodeReviewCommit n = toMerge.remove(0);
try { try {
if (newMergeTip == null) { if (mergeTip == null) {
// The branch is unborn. Take a fast-forward resolution to // The branch is unborn. Take a fast-forward resolution to
// create the branch. // create the branch.
// //
newMergeTip = n; mergeTip = n;
n.setStatusCode(CommitMergeStatus.CLEAN_MERGE); n.setStatusCode(CommitMergeStatus.CLEAN_MERGE);
} else if (n.getParentCount() == 0) { } else if (n.getParentCount() == 0) {
@@ -86,10 +85,10 @@ public class CherryPick extends SubmitStrategy {
// that on the current merge tip. // that on the current merge tip.
// //
newMergeTip = writeCherryPickCommit(mergeTip, n); mergeTip = writeCherryPickCommit(mergeTip, n);
if (newMergeTip != null) { if (mergeTip != null) {
newCommits.put(newMergeTip.getPatchsetId().getParentKey(), newMergeTip); newCommits.put(mergeTip.getPatchsetId().getParentKey(), mergeTip);
} else { } else {
n.setStatusCode(CommitMergeStatus.PATH_CONFLICT); n.setStatusCode(CommitMergeStatus.PATH_CONFLICT);
} }
@@ -102,17 +101,17 @@ public class CherryPick extends SubmitStrategy {
// instead behave as though MERGE_IF_NECESSARY was configured. // instead behave as though MERGE_IF_NECESSARY was configured.
// //
if (!args.mergeUtil.hasMissingDependencies(args.mergeSorter, n)) { if (!args.mergeUtil.hasMissingDependencies(args.mergeSorter, n)) {
if (args.rw.isMergedInto(newMergeTip, n)) { if (args.rw.isMergedInto(mergeTip, n)) {
newMergeTip = n; mergeTip = n;
} else { } else {
newMergeTip = mergeTip =
args.mergeUtil.mergeOneCommit(args.myIdent, args.repo, args.mergeUtil.mergeOneCommit(args.myIdent, args.repo,
args.rw, args.inserter, args.canMergeFlag, args.rw, args.inserter, args.canMergeFlag,
args.destBranch, newMergeTip, n); args.destBranch, mergeTip, n);
} }
final PatchSetApproval submitApproval = final PatchSetApproval submitApproval =
args.mergeUtil.markCleanMerges(args.rw, args.canMergeFlag, args.mergeUtil.markCleanMerges(args.rw, args.canMergeFlag,
newMergeTip, args.alreadyAccepted); mergeTip, args.alreadyAccepted);
setRefLogIdent(submitApproval); setRefLogIdent(submitApproval);
} else { } else {
@@ -127,7 +126,7 @@ public class CherryPick extends SubmitStrategy {
throw new MergeException("Cannot merge " + n.name(), e); throw new MergeException("Cannot merge " + n.name(), e);
} }
} }
return newMergeTip; return mergeTip;
} }
private CodeReviewCommit writeCherryPickCommit(CodeReviewCommit mergeTip, private CodeReviewCommit writeCherryPickCommit(CodeReviewCommit mergeTip,