Merge "Remove redundant footerLines argument from ChangeInserter"

This commit is contained in:
David Pursehouse
2013-04-22 10:00:16 +00:00
committed by Gerrit Code Review
3 changed files with 9 additions and 12 deletions

View File

@@ -304,8 +304,7 @@ public class ChangeUtil {
LabelTypes labelTypes = refControl.getProjectControl().getLabelTypes(); LabelTypes labelTypes = refControl.getProjectControl().getLabelTypes();
changeInserter.insertChange(db, change, cmsg, ps, revertCommit, changeInserter.insertChange(db, change, cmsg, ps, revertCommit,
labelTypes, revertCommit.getFooterLines(), info, labelTypes, info, Collections.<Account.Id> emptySet());
Collections.<Account.Id> emptySet());
final RevertedSender cm = revertedSenderFactory.create(change); final RevertedSender cm = revertedSenderFactory.create(change);
cm.setFrom(user.getAccountId()); cm.setFrom(user.getAccountId());

View File

@@ -30,11 +30,9 @@ import com.google.gwtorm.server.OrmException;
import com.google.inject.Inject; import com.google.inject.Inject;
import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.revwalk.FooterLine;
import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.revwalk.RevCommit;
import java.util.Collections; import java.util.Collections;
import java.util.List;
import java.util.Set; import java.util.Set;
public class ChangeInserter { public class ChangeInserter {
@@ -54,22 +52,22 @@ public class ChangeInserter {
} }
public void insertChange(ReviewDb db, Change change, PatchSet ps, public void insertChange(ReviewDb db, Change change, PatchSet ps,
RevCommit commit, LabelTypes labelTypes, List<FooterLine> footerLines, RevCommit commit, LabelTypes labelTypes, PatchSetInfo info,
PatchSetInfo info, Set<Account.Id> reviewers) throws OrmException { Set<Account.Id> reviewers) throws OrmException {
insertChange(db, change, null, ps, commit, labelTypes, footerLines, info, reviewers); insertChange(db, change, null, ps, commit, labelTypes, info, reviewers);
} }
public void insertChange(ReviewDb db, Change change, public void insertChange(ReviewDb db, Change change,
ChangeMessage changeMessage, PatchSet ps, RevCommit commit, ChangeMessage changeMessage, PatchSet ps, RevCommit commit,
LabelTypes labelTypes, List<FooterLine> footerLines, PatchSetInfo info, LabelTypes labelTypes, PatchSetInfo info, Set<Account.Id> reviewers)
Set<Account.Id> reviewers) throws OrmException { throws OrmException {
db.changes().beginTransaction(change.getId()); db.changes().beginTransaction(change.getId());
try { try {
ChangeUtil.insertAncestors(db, ps.getId(), commit); ChangeUtil.insertAncestors(db, ps.getId(), commit);
db.patchSets().insert(Collections.singleton(ps)); db.patchSets().insert(Collections.singleton(ps));
db.changes().insert(Collections.singleton(change)); db.changes().insert(Collections.singleton(change));
ChangeUtil.updateTrackingIds(db, change, trackingFooters, footerLines); ChangeUtil.updateTrackingIds(db, change, trackingFooters, commit.getFooterLines());
approvalsUtil.addReviewers(db, labelTypes, change, ps, info, reviewers, approvalsUtil.addReviewers(db, labelTypes, change, ps, info, reviewers,
Collections.<Account.Id> emptySet()); Collections.<Account.Id> emptySet());
if (changeMessage != null) { if (changeMessage != null) {

View File

@@ -1466,8 +1466,8 @@ public class ReceiveCommits {
recipients.add(getRecipientsFromFooters(accountResolver, ps, footerLines)); recipients.add(getRecipientsFromFooters(accountResolver, ps, footerLines));
recipients.remove(me); recipients.remove(me);
changeInserter.insertChange(db, change, ps, commit, labelTypes, changeInserter.insertChange(db, change, ps, commit, labelTypes, info,
footerLines, info, recipients.getReviewers()); recipients.getReviewers());
created = true; created = true;