Refactor ChangeSet#changesByProject() to return ChangeData
ChangeSet#changesByProject() used to return Change.Id then the method which calls this method retrieve Change.Data by the Change.Id. Also to be consistent with changesByBranch() method. Change-Id: I446c52626998bac9f4e33885e2864ccec2798c22
This commit is contained in:
@@ -83,12 +83,11 @@ public class ChangeSet {
|
||||
return ret;
|
||||
}
|
||||
|
||||
public Multimap<Project.NameKey, Change.Id> changesByProject()
|
||||
public Multimap<Project.NameKey, ChangeData> changesByProject()
|
||||
throws OrmException {
|
||||
ListMultimap<Project.NameKey, Change.Id> ret =
|
||||
ArrayListMultimap.create();
|
||||
ListMultimap<Project.NameKey, ChangeData> ret = ArrayListMultimap.create();
|
||||
for (ChangeData cd : changeData.values()) {
|
||||
ret.put(cd.change().getProject(), cd.getId());
|
||||
ret.put(cd.change().getProject(), cd);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -107,13 +107,11 @@ public class MergeSuperSet {
|
||||
CurrentUser user) throws MissingObjectException,
|
||||
IncorrectObjectTypeException, IOException, OrmException {
|
||||
List<ChangeData> ret = new ArrayList<>();
|
||||
|
||||
Multimap<Project.NameKey, Change.Id> pc = changes.changesByProject();
|
||||
Multimap<Project.NameKey, ChangeData> pc = changes.changesByProject();
|
||||
for (Project.NameKey project : pc.keySet()) {
|
||||
try (Repository repo = repoManager.openRepository(project);
|
||||
RevWalk rw = CodeReviewCommit.newRevWalk(repo)) {
|
||||
for (Change.Id cId : pc.get(project)) {
|
||||
ChangeData cd = changeDataFactory.create(db, project, cId);
|
||||
for (ChangeData cd : pc.get(project)) {
|
||||
cd.changeControl(user);
|
||||
|
||||
SubmitTypeRecord str = cd.submitTypeRecord();
|
||||
|
||||
Reference in New Issue
Block a user