ReceiveCommits: Fix debug log and comment

Since a long time projects can have multiple changes with the same
Change-Id, but uploaded for different branches. The code already loaded
the changes by branch + Change-Id, but the debug statement and the
comment were still assuming that they were loaded by project +
Change-Id.

Change-Id: I807666ed4a5de9d5de4c32ee77195071aa942757
Signed-off-by: Edwin Kempin <ekempin@google.com>
This commit is contained in:
Edwin Kempin
2017-01-31 11:42:49 +01:00
parent 8fc133ed47
commit 6d2fedd8e6

View File

@@ -1804,15 +1804,16 @@ public class ReceiveCommits {
List<ChangeData> changes = p.destChanges;
if (changes.size() > 1) {
logDebug("Multiple changes in project with Change-Id {}: {}",
logDebug("Multiple changes in branch {} with Change-Id {}: {}",
magicBranch.dest,
p.changeKey,
changes.stream()
.map(cd -> cd.getId().toString())
.collect(joining()));
// WTF, multiple changes in this project have the same key?
// WTF, multiple changes in this branch have the same key?
// Since the commit is new, the user should recreate it with
// a different Change-Id. In practice, we should never see
// this error message as Change-Id should be unique.
// this error message as Change-Id should be unique per branch.
//
reject(magicBranch.cmd, p.changeKey.get() + " has duplicates");
newChanges = Collections.emptyList();