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:
@@ -1804,15 +1804,16 @@ public class ReceiveCommits {
|
|||||||
|
|
||||||
List<ChangeData> changes = p.destChanges;
|
List<ChangeData> changes = p.destChanges;
|
||||||
if (changes.size() > 1) {
|
if (changes.size() > 1) {
|
||||||
logDebug("Multiple changes in project with Change-Id {}: {}",
|
logDebug("Multiple changes in branch {} with Change-Id {}: {}",
|
||||||
|
magicBranch.dest,
|
||||||
p.changeKey,
|
p.changeKey,
|
||||||
changes.stream()
|
changes.stream()
|
||||||
.map(cd -> cd.getId().toString())
|
.map(cd -> cd.getId().toString())
|
||||||
.collect(joining()));
|
.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
|
// Since the commit is new, the user should recreate it with
|
||||||
// a different Change-Id. In practice, we should never see
|
// 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");
|
reject(magicBranch.cmd, p.changeKey.get() + " has duplicates");
|
||||||
newChanges = Collections.emptyList();
|
newChanges = Collections.emptyList();
|
||||||
|
|||||||
Reference in New Issue
Block a user