Merge branch 'stable-2.8'

* stable-2.8:
  Update 2.8.2 release notes
  Bump version to 2.8.2 in plugin API and archetypes
  Prevent duplicate commits in same project when uploading to refs/changes/n
  Bump GERRIT_VERSION to 2.8.2
  Update 2.8.2 release notes
  PostReview: update and insert comments/approvals in a single step

Conflicts:
	VERSION
	gerrit-plugin-archetype/pom.xml
	gerrit-plugin-gwt-archetype/pom.xml
	gerrit-plugin-gwtui/pom.xml
	gerrit-plugin-js-archetype/pom.xml
	gerrit-server/src/main/java/com/google/gerrit/server/change/PostReview.java
	gerrit-server/src/main/java/com/google/gerrit/server/git/ReceiveCommits.java

Change-Id: I7a611d4f9c16b8d5f3abdcd8228fca0b636d792c
This commit is contained in:
David Pursehouse 2014-03-11 18:21:56 +09:00
commit c2ba9a65a7
4 changed files with 45 additions and 14 deletions

View File

@ -1,9 +1,18 @@
= commit already exists
With this error message Gerrit rejects to push a commit to an
existing change via `refs/changes/n` if the commit was already
successfully pushed to the change. In this case there is no
new commit and consequently there is nothing for Gerrit to do.
With "commit already exists (as current patchset)" or
"commit already exists (in the change)" error message
Gerrit rejects to push a commit to an existing change via
`refs/changes/n` if the commit was already successfully
pushed to the change.
With "commit already exists (in the project)" error message
Gerrit rejects to push a commit to an existing change via
`refs/changes/n` if the commit was already successfully
pushed to a change in project scope.
In any above case there is no new commit and consequently
there is nothing for Gerrit to do.
For further information about how to resolve this error, please
refer to link:error-no-new-changes.html[no new changes].

View File

@ -1,8 +1,9 @@
= no new changes
With this error message Gerrit rejects to push a commit if the pushed
commit was already successfully pushed to Gerrit. In this case there
is no new change and consequently there is nothing for Gerrit to do.
commit was already successfully pushed to Gerrit in project scope.
In this case there is no new change and consequently there is nothing
for Gerrit to do.
If your push is failing with this error message, you normally
don't have to do anything since the commit was already successfully
@ -30,7 +31,7 @@ means:
. you cannot reset a change to an old patch set by pushing the old
commit for this change again
. if a commit was pushed to one branch you cannot push this commit
to another branch
to another branch in project scope.
. if a commit was pushed directly to a branch (without going through
code review) you cannot push this commit once again for code
review (please note that in this case searching by the commit ID
@ -38,11 +39,11 @@ means:
If you need to re-push a commit you may rewrite this commit by
link:http://www.kernel.org/pub/software/scm/git/docs/git-commit.html[amending] it or doing an interactive link:http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html[git rebase]. By rewriting the
commit you actually create a new commit (with a new commit ID) which
can then be pushed to Gerrit. If the old commit contains a Change-Id
in the commit message you also need to replace it with a new
Change-Id (case 1. and 3. above), otherwise the push will fail with
another error message.
commit you actually create a new commit (with a new commit ID in
project scope) which can then be pushed to Gerrit. If the old commit
contains a Change-Id in the commit message you also need to replace
it with a new Change-Id (case 1. and 3. above), otherwise the push
will fail with another error message.
GERRIT

View File

@ -124,6 +124,19 @@ Handle null commits when updating submodules.
In some edge cases it was possible that a null commit would exist, and this
caused a crash when updating submodules.
* Update and insert comments/approvals in a single step.
+
When a review includes both new label scores and updates to existing label
scores, use `upsert` to record them all at the same time, rather than in
separate `update` and `insert` operations.
* link:https://code.google.com/p/gerrit/issues/detail?id=2374[Issue 2374]:
Prevent duplicate commits in same project when uploading to `refs/changes/n`.
+
Under certain circumstances, when pushing to `refs/changes/n`, the same
commit could be pushed onto multiple changes even if the changes were on the
same branch.
* Remove dependency on joda time library in gerrit launcher.
+
The joda time library was being unnecessarily packaged in the root of

View File

@ -1780,7 +1780,7 @@ public class ReceiveCommits {
if (newCommit == priorCommit) {
// Ignore requests to make the change its current state.
skip = true;
reject(inputCommand, "commit already exists");
reject(inputCommand, "commit already exists (as current patchset)");
return false;
}
@ -1792,10 +1792,18 @@ public class ReceiveCommits {
reject(inputCommand, "change " + ontoChange + " closed");
return false;
} else if (revisions.containsKey(newCommit)) {
reject(inputCommand, "commit already exists");
reject(inputCommand, "commit already exists (in the change)");
return false;
}
for (final Ref r : rp.getRepository().getRefDatabase()
.getRefs("refs/changes").values()) {
if (r.getObjectId().equals(inputCommand.getNewId())) {
reject(inputCommand, "commit already exists (in the project)");
return false;
}
}
for (RevCommit prior : revisions.keySet()) {
// Don't allow a change to directly depend upon itself. This is a
// very common error due to users making a new commit rather than