From 53cd95966f554face2c909562d9e73570dc5b3a5 Mon Sep 17 00:00:00 2001 From: Edwin Kempin Date: Wed, 12 Dec 2018 08:52:39 +0100 Subject: [PATCH] Remove ReviewDb parameter from PushOneCommit.Factory methods Change-Id: I81d26afc961496afbbeceabd304469e9613871b8 Signed-off-by: Edwin Kempin --- .../gerrit/acceptance/AbstractDaemonTest.java | 21 ++---- .../acceptance/AbstractNotificationTest.java | 2 +- .../gerrit/acceptance/PushOneCommit.java | 45 ++---------- .../acceptance/api/accounts/AccountIT.java | 31 +++----- .../acceptance/api/accounts/AgreementsIT.java | 2 +- .../acceptance/api/change/ChangeIT.java | 70 ++++++++----------- .../api/change/DisablePrivateChangesIT.java | 14 ++-- .../acceptance/api/change/MergeListIT.java | 10 +-- .../api/change/StickyApprovalsIT.java | 7 +- .../api/change/SubmitTypeRuleIT.java | 1 - .../gerrit/acceptance/api/group/GroupsIT.java | 11 ++- .../api/revision/RevisionDiffIT.java | 6 +- .../acceptance/api/revision/RevisionIT.java | 28 +++----- .../api/revision/RobotCommentsIT.java | 6 +- .../gerrit/acceptance/edit/ChangeEditIT.java | 8 +-- .../acceptance/git/AbstractPushForReview.java | 53 +++++--------- .../gerrit/acceptance/git/ForcePushIT.java | 8 +-- .../acceptance/git/ImplicitMergeCheckIT.java | 3 +- .../acceptance/git/RefAdvertisementIT.java | 10 +-- .../gerrit/acceptance/git/SubmitOnPushIT.java | 6 +- .../git/SubmoduleSubscriptionsIT.java | 2 +- .../gerrit/acceptance/rest/TraceIT.java | 12 ++-- .../rest/change/AbstractSubmit.java | 31 ++++---- .../rest/change/AbstractSubmitByMerge.java | 4 +- .../rest/change/AbstractSubmitByRebase.java | 2 +- .../acceptance/rest/change/ChangeOwnerIT.java | 2 +- .../rest/change/ConfigChangeIT.java | 9 +-- .../rest/change/CreateChangeIT.java | 6 +- .../acceptance/rest/change/IndexChangeIT.java | 2 +- .../rest/change/ListChangesOptionsIT.java | 3 +- .../acceptance/rest/change/MoveChangeIT.java | 2 +- .../rest/change/PrivateByDefaultIT.java | 8 +-- .../change/SubmitByMergeIfNecessaryIT.java | 27 +++---- .../change/SubmitResolvingMergeCommitIT.java | 2 +- .../change/WorkInProgressByDefaultIT.java | 2 +- .../acceptance/rest/project/AccessIT.java | 2 +- .../acceptance/rest/project/GetCommitIT.java | 6 +- .../rest/project/ProjectLevelConfigIT.java | 11 +-- .../acceptance/rest/project/TagsIT.java | 8 +-- .../acceptance/server/change/CommentsIT.java | 26 +++---- .../server/change/GetRelatedIT.java | 2 +- .../server/mail/AbstractMailIT.java | 2 +- .../server/mail/ChangeNotificationsIT.java | 2 +- .../server/project/ProjectWatchIT.java | 54 ++++++-------- .../rules/IgnoreSelfApprovalRuleIT.java | 2 +- .../acceptance/server/rules/RulesIT.java | 2 +- plugins/webhooks | 2 +- 47 files changed, 211 insertions(+), 364 deletions(-) diff --git a/java/com/google/gerrit/acceptance/AbstractDaemonTest.java b/java/com/google/gerrit/acceptance/AbstractDaemonTest.java index 6e3b100dd0..c4947a4866 100644 --- a/java/com/google/gerrit/acceptance/AbstractDaemonTest.java +++ b/java/com/google/gerrit/acceptance/AbstractDaemonTest.java @@ -633,7 +633,7 @@ public abstract class AbstractDaemonTest { } protected PushOneCommit.Result createChange(String ref) throws Exception { - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); PushOneCommit.Result result = push.to(ref); result.assertOkStatus(); return result; @@ -649,7 +649,6 @@ public abstract class AbstractDaemonTest { PushOneCommit.Result p1 = pushFactory .create( - db, admin.getIdent(), testRepo, "parent 1", @@ -662,7 +661,6 @@ public abstract class AbstractDaemonTest { PushOneCommit.Result p2 = pushFactory .create( - db, admin.getIdent(), testRepo, "parent 2", @@ -671,11 +669,7 @@ public abstract class AbstractDaemonTest { PushOneCommit m = pushFactory.create( - db, - admin.getIdent(), - testRepo, - "merge", - ImmutableMap.of(file, "foo-1", "bar", "bar-2")); + admin.getIdent(), testRepo, "merge", ImmutableMap.of(file, "foo-1", "bar", "bar-2")); m.setParents(ImmutableList.of(p1.getCommit(), p2.getCommit())); PushOneCommit.Result result = m.to(ref); result.assertOkStatus(); @@ -690,7 +684,7 @@ public abstract class AbstractDaemonTest { String content) throws Exception { PushOneCommit.Result result = - pushFactory.create(db, admin.getIdent(), repo, commitMsg, fileName, content).to(ref); + pushFactory.create(admin.getIdent(), repo, commitMsg, fileName, content).to(ref); result.assertOkStatus(); return result; } @@ -709,8 +703,7 @@ public abstract class AbstractDaemonTest { protected PushOneCommit.Result createChange(String subject, String fileName, String content) throws Exception { - PushOneCommit push = - pushFactory.create(db, admin.getIdent(), testRepo, subject, fileName, content); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo, subject, fileName, content); return push.to("refs/for/master"); } @@ -722,7 +715,7 @@ public abstract class AbstractDaemonTest { String content, String topic) throws Exception { - PushOneCommit push = pushFactory.create(db, admin.getIdent(), repo, subject, fileName, content); + PushOneCommit push = pushFactory.create(admin.getIdent(), repo, subject, fileName, content); return push.to("refs/for/" + branch + "%topic=" + name(topic)); } @@ -776,7 +769,7 @@ public abstract class AbstractDaemonTest { String content) throws Exception { PushOneCommit push = - pushFactory.create(db, testAccount.getIdent(), repo, subject, fileName, content, changeId); + pushFactory.create(testAccount.getIdent(), repo, subject, fileName, content, changeId); return push.to(ref); } @@ -1112,7 +1105,7 @@ public abstract class AbstractDaemonTest { } protected PushOneCommit.Result pushTo(String ref) throws Exception { - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); return push.to(ref); } diff --git a/java/com/google/gerrit/acceptance/AbstractNotificationTest.java b/java/com/google/gerrit/acceptance/AbstractNotificationTest.java index 7a30f0cd8f..8b79ee9736 100644 --- a/java/com/google/gerrit/acceptance/AbstractNotificationTest.java +++ b/java/com/google/gerrit/acceptance/AbstractNotificationTest.java @@ -459,7 +459,7 @@ public abstract class AbstractNotificationTest extends AbstractDaemonTest { } setApiUser(owner); repo = cloneProject(project, owner); - PushOneCommit push = pushFactory.create(db, owner.getIdent(), repo); + PushOneCommit push = pushFactory.create(owner.getIdent(), repo); result = push.to(ref); result.assertOkStatus(); changeId = result.getChangeId(); diff --git a/java/com/google/gerrit/acceptance/PushOneCommit.java b/java/com/google/gerrit/acceptance/PushOneCommit.java index 99e07ea23e..f16f1d3892 100644 --- a/java/com/google/gerrit/acceptance/PushOneCommit.java +++ b/java/com/google/gerrit/acceptance/PushOneCommit.java @@ -27,7 +27,6 @@ import com.google.gerrit.common.Nullable; import com.google.gerrit.reviewdb.client.Account; import com.google.gerrit.reviewdb.client.Change; import com.google.gerrit.reviewdb.client.PatchSet; -import com.google.gerrit.reviewdb.server.ReviewDb; import com.google.gerrit.server.ApprovalsUtil; import com.google.gerrit.server.notedb.ChangeNotes; import com.google.gerrit.server.notedb.ReviewerStateInternal; @@ -74,16 +73,12 @@ public class PushOneCommit { + PATCH_FILE_ONLY; public interface Factory { - PushOneCommit create(ReviewDb db, PersonIdent i, TestRepository testRepo); + PushOneCommit create(PersonIdent i, TestRepository testRepo); PushOneCommit create( - ReviewDb db, - PersonIdent i, - TestRepository testRepo, - @Assisted("changeId") String changeId); + PersonIdent i, TestRepository testRepo, @Assisted("changeId") String changeId); PushOneCommit create( - ReviewDb db, PersonIdent i, TestRepository testRepo, @Assisted("subject") String subject, @@ -91,14 +86,12 @@ public class PushOneCommit { @Assisted("content") String content); PushOneCommit create( - ReviewDb db, PersonIdent i, TestRepository testRepo, @Assisted String subject, @Assisted Map files); PushOneCommit create( - ReviewDb db, PersonIdent i, TestRepository testRepo, @Assisted("subject") String subject, @@ -157,20 +150,10 @@ public class PushOneCommit { ChangeNotes.Factory notesFactory, ApprovalsUtil approvalsUtil, Provider queryProvider, - @Assisted ReviewDb db, @Assisted PersonIdent i, @Assisted TestRepository testRepo) throws Exception { - this( - notesFactory, - approvalsUtil, - queryProvider, - db, - i, - testRepo, - SUBJECT, - FILE_NAME, - FILE_CONTENT); + this(notesFactory, approvalsUtil, queryProvider, i, testRepo, SUBJECT, FILE_NAME, FILE_CONTENT); } @AssistedInject @@ -178,7 +161,6 @@ public class PushOneCommit { ChangeNotes.Factory notesFactory, ApprovalsUtil approvalsUtil, Provider queryProvider, - @Assisted ReviewDb db, @Assisted PersonIdent i, @Assisted TestRepository testRepo, @Assisted("changeId") String changeId) @@ -187,7 +169,6 @@ public class PushOneCommit { notesFactory, approvalsUtil, queryProvider, - db, i, testRepo, SUBJECT, @@ -201,24 +182,13 @@ public class PushOneCommit { ChangeNotes.Factory notesFactory, ApprovalsUtil approvalsUtil, Provider queryProvider, - @Assisted ReviewDb db, @Assisted PersonIdent i, @Assisted TestRepository testRepo, @Assisted("subject") String subject, @Assisted("fileName") String fileName, @Assisted("content") String content) throws Exception { - this( - notesFactory, - approvalsUtil, - queryProvider, - db, - i, - testRepo, - subject, - fileName, - content, - null); + this(notesFactory, approvalsUtil, queryProvider, i, testRepo, subject, fileName, content, null); } @AssistedInject @@ -226,13 +196,12 @@ public class PushOneCommit { ChangeNotes.Factory notesFactory, ApprovalsUtil approvalsUtil, Provider queryProvider, - @Assisted ReviewDb db, @Assisted PersonIdent i, @Assisted TestRepository testRepo, @Assisted String subject, @Assisted Map files) throws Exception { - this(notesFactory, approvalsUtil, queryProvider, db, i, testRepo, subject, files, null); + this(notesFactory, approvalsUtil, queryProvider, i, testRepo, subject, files, null); } @AssistedInject @@ -240,7 +209,6 @@ public class PushOneCommit { ChangeNotes.Factory notesFactory, ApprovalsUtil approvalsUtil, Provider queryProvider, - @Assisted ReviewDb db, @Assisted PersonIdent i, @Assisted TestRepository testRepo, @Assisted("subject") String subject, @@ -252,7 +220,6 @@ public class PushOneCommit { notesFactory, approvalsUtil, queryProvider, - db, i, testRepo, subject, @@ -264,8 +231,6 @@ public class PushOneCommit { ChangeNotes.Factory notesFactory, ApprovalsUtil approvalsUtil, Provider queryProvider, - // TODO(ekempin): Remove unused ReviewDb - @SuppressWarnings("unused") ReviewDb db, PersonIdent i, TestRepository testRepo, String subject, diff --git a/javatests/com/google/gerrit/acceptance/api/accounts/AccountIT.java b/javatests/com/google/gerrit/acceptance/api/accounts/AccountIT.java index 665561782a..c4a66a5338 100644 --- a/javatests/com/google/gerrit/acceptance/api/accounts/AccountIT.java +++ b/javatests/com/google/gerrit/acceptance/api/accounts/AccountIT.java @@ -1234,11 +1234,11 @@ public class AccountIT extends AbstractDaemonTest { TestRepository allUsersRepo = cloneProject(allUsers); fetch(allUsersRepo, RefNames.refsUsers(admin.id) + ":userRef"); allUsersRepo.reset("userRef"); - PushOneCommit push = pushFactory.create(db, admin.getIdent(), allUsersRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), allUsersRepo); push.to(RefNames.refsUsers(admin.id)).assertOkStatus(); accountIndexedCounter.assertReindexOf(admin); - push = pushFactory.create(db, admin.getIdent(), allUsersRepo); + push = pushFactory.create(admin.getIdent(), allUsersRepo); push.to(RefNames.REFS_USERS_SELF).assertOkStatus(); accountIndexedCounter.assertReindexOf(admin); } @@ -1249,7 +1249,7 @@ public class AccountIT extends AbstractDaemonTest { TestRepository allUsersRepo = cloneProject(allUsers); fetch(allUsersRepo, userRefName + ":userRef"); allUsersRepo.reset("userRef"); - PushOneCommit push = pushFactory.create(db, admin.getIdent(), allUsersRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), allUsersRepo); PushOneCommit.Result r = push.to(MagicBranch.NEW_CHANGE + userRefName); r.assertOkStatus(); accountIndexedCounter.assertNoReindex(); @@ -1258,7 +1258,7 @@ public class AccountIT extends AbstractDaemonTest { gApi.changes().id(r.getChangeId()).current().submit(); accountIndexedCounter.assertReindexOf(admin); - push = pushFactory.create(db, admin.getIdent(), allUsersRepo); + push = pushFactory.create(admin.getIdent(), allUsersRepo); r = push.to(MagicBranch.NEW_CHANGE + RefNames.REFS_USERS_SELF); r.assertOkStatus(); accountIndexedCounter.assertNoReindex(); @@ -1281,7 +1281,6 @@ public class AccountIT extends AbstractDaemonTest { PushOneCommit.Result r = pushFactory .create( - db, admin.getIdent(), allUsersRepo, "Update account config", @@ -1320,7 +1319,6 @@ public class AccountIT extends AbstractDaemonTest { PushOneCommit.Result r = pushFactory .create( - db, foo.getIdent(), allUsersRepo, "Update account config", @@ -1353,7 +1351,6 @@ public class AccountIT extends AbstractDaemonTest { PushOneCommit.Result r = pushFactory .create( - db, admin.getIdent(), allUsersRepo, "Update account config", @@ -1393,7 +1390,6 @@ public class AccountIT extends AbstractDaemonTest { PushOneCommit.Result r = pushFactory .create( - db, admin.getIdent(), allUsersRepo, "Update account config", @@ -1427,7 +1423,6 @@ public class AccountIT extends AbstractDaemonTest { PushOneCommit.Result r = pushFactory .create( - db, admin.getIdent(), allUsersRepo, "Update account config", @@ -1467,7 +1462,6 @@ public class AccountIT extends AbstractDaemonTest { PushOneCommit.Result r = pushFactory .create( - db, admin.getIdent(), allUsersRepo, "Update account config", @@ -1499,7 +1493,6 @@ public class AccountIT extends AbstractDaemonTest { ProjectWatches.NotifyValue.create(null, EnumSet.of(NotifyType.ALL_COMMENTS)).toString()); PushOneCommit push = pushFactory.create( - db, admin.getIdent(), allUsersRepo, "Add project watch", @@ -1513,7 +1506,6 @@ public class AccountIT extends AbstractDaemonTest { ProjectWatches.PROJECT, project.get(), ProjectWatches.KEY_NOTIFY, invalidNotifyValue); push = pushFactory.create( - db, admin.getIdent(), allUsersRepo, "Add invalid project watch", @@ -1543,7 +1535,6 @@ public class AccountIT extends AbstractDaemonTest { accountIndexedCounter.clear(); pushFactory .create( - db, oooUser.getIdent(), allUsersRepo, "Update account config", @@ -1569,7 +1560,6 @@ public class AccountIT extends AbstractDaemonTest { PushOneCommit.Result r = pushFactory .create( - db, admin.getIdent(), allUsersRepo, "Update account config", @@ -1602,7 +1592,6 @@ public class AccountIT extends AbstractDaemonTest { PushOneCommit.Result r = pushFactory .create( - db, admin.getIdent(), allUsersRepo, "Update account config", @@ -1637,7 +1626,6 @@ public class AccountIT extends AbstractDaemonTest { pushFactory .create( - db, foo.getIdent(), allUsersRepo, "Update account config", @@ -1671,7 +1659,6 @@ public class AccountIT extends AbstractDaemonTest { pushFactory .create( - db, foo.getIdent(), allUsersRepo, "Update account config", @@ -1698,7 +1685,6 @@ public class AccountIT extends AbstractDaemonTest { PushOneCommit.Result r = pushFactory .create( - db, admin.getIdent(), allUsersRepo, "Update account config", @@ -1730,7 +1716,6 @@ public class AccountIT extends AbstractDaemonTest { pushFactory .create( - db, admin.getIdent(), allUsersRepo, "Update account config", @@ -1750,7 +1735,7 @@ public class AccountIT extends AbstractDaemonTest { String userRef = RefNames.refsUsers(new Account.Id(seq.nextAccountId())); TestRepository allUsersRepo = cloneProject(allUsers); - PushOneCommit.Result r = pushFactory.create(db, admin.getIdent(), allUsersRepo).to(userRef); + PushOneCommit.Result r = pushFactory.create(admin.getIdent(), allUsersRepo).to(userRef); r.assertErrorStatus(); assertThat(r.getMessage()).contains("Not allowed to create user branch."); @@ -1767,7 +1752,7 @@ public class AccountIT extends AbstractDaemonTest { String userRef = RefNames.refsUsers(new Account.Id(seq.nextAccountId())); TestRepository allUsersRepo = cloneProject(allUsers); - pushFactory.create(db, admin.getIdent(), allUsersRepo).to(userRef).assertOkStatus(); + pushFactory.create(admin.getIdent(), allUsersRepo).to(userRef).assertOkStatus(); try (Repository repo = repoManager.openRepository(allUsers)) { assertThat(repo.exactRef(userRef)).isNotNull(); @@ -1783,7 +1768,7 @@ public class AccountIT extends AbstractDaemonTest { String userRef = RefNames.REFS_USERS + "foo"; TestRepository allUsersRepo = cloneProject(allUsers); - PushOneCommit.Result r = pushFactory.create(db, admin.getIdent(), allUsersRepo).to(userRef); + PushOneCommit.Result r = pushFactory.create(admin.getIdent(), allUsersRepo).to(userRef); r.assertErrorStatus(); assertThat(r.getMessage()).contains("Not allowed to create non-user branch under refs/users/."); @@ -1803,7 +1788,7 @@ public class AccountIT extends AbstractDaemonTest { TestRepository allUsersRepo = cloneProject(allUsers); pushFactory - .create(db, admin.getIdent(), allUsersRepo) + .create(admin.getIdent(), allUsersRepo) .to(RefNames.REFS_USERS_DEFAULT) .assertOkStatus(); diff --git a/javatests/com/google/gerrit/acceptance/api/accounts/AgreementsIT.java b/javatests/com/google/gerrit/acceptance/api/accounts/AgreementsIT.java index b441630223..0a64a1df4c 100644 --- a/javatests/com/google/gerrit/acceptance/api/accounts/AgreementsIT.java +++ b/javatests/com/google/gerrit/acceptance/api/accounts/AgreementsIT.java @@ -358,7 +358,7 @@ public class AgreementsIT extends AbstractDaemonTest { public void publishEditRestWithoutCLA() throws Exception { String filename = "foo"; PushOneCommit push = - pushFactory.create(db, admin.getIdent(), testRepo, "subject1", filename, "contentold"); + pushFactory.create(admin.getIdent(), testRepo, "subject1", filename, "contentold"); PushOneCommit.Result result = push.to("refs/for/master"); result.assertOkStatus(); String changeId = result.getChangeId(); diff --git a/javatests/com/google/gerrit/acceptance/api/change/ChangeIT.java b/javatests/com/google/gerrit/acceptance/api/change/ChangeIT.java index 324f33ba8e..b1e2b6e250 100644 --- a/javatests/com/google/gerrit/acceptance/api/change/ChangeIT.java +++ b/javatests/com/google/gerrit/acceptance/api/change/ChangeIT.java @@ -259,7 +259,7 @@ public class ChangeIT extends AbstractDaemonTest { public void setPrivateByOwner() throws Exception { TestRepository userRepo = cloneProject(project, user); PushOneCommit.Result result = - pushFactory.create(db, user.getIdent(), userRepo).to("refs/for/master"); + pushFactory.create(user.getIdent(), userRepo).to("refs/for/master"); setApiUser(user); String changeId = result.getChangeId(); @@ -296,7 +296,7 @@ public class ChangeIT extends AbstractDaemonTest { public void administratorCanSetUserChangePrivate() throws Exception { TestRepository userRepo = cloneProject(project, user); PushOneCommit.Result result = - pushFactory.create(db, user.getIdent(), userRepo).to("refs/for/master"); + pushFactory.create(user.getIdent(), userRepo).to("refs/for/master"); String changeId = result.getChangeId(); assertThat(gApi.changes().id(changeId).get().isPrivate).isNull(); @@ -320,7 +320,7 @@ public class ChangeIT extends AbstractDaemonTest { public void accessPrivate() throws Exception { TestRepository userRepo = cloneProject(project, user); PushOneCommit.Result result = - pushFactory.create(db, user.getIdent(), userRepo).to("refs/for/master"); + pushFactory.create(user.getIdent(), userRepo).to("refs/for/master"); setApiUser(user); gApi.changes().id(result.getChangeId()).setPrivate(true, null); @@ -378,7 +378,7 @@ public class ChangeIT extends AbstractDaemonTest { public void ownerCannotMarkPrivateAfterMerging() throws Exception { TestRepository userRepo = cloneProject(project, user); PushOneCommit.Result result = - pushFactory.create(db, user.getIdent(), userRepo).to("refs/for/master"); + pushFactory.create(user.getIdent(), userRepo).to("refs/for/master"); String changeId = result.getChangeId(); assertThat(gApi.changes().id(changeId).get().isPrivate).isNull(); @@ -395,7 +395,7 @@ public class ChangeIT extends AbstractDaemonTest { public void ownerCanUnmarkPrivateAfterMerging() throws Exception { TestRepository userRepo = cloneProject(project, user); PushOneCommit.Result result = - pushFactory.create(db, user.getIdent(), userRepo).to("refs/for/master"); + pushFactory.create(user.getIdent(), userRepo).to("refs/for/master"); String changeId = result.getChangeId(); assertThat(gApi.changes().id(changeId).get().isPrivate).isNull(); @@ -695,7 +695,7 @@ public class ChangeIT extends AbstractDaemonTest { @Test @TestProjectInput(cloneAs = "user") public void reviewWithWorkInProgressChangeOwner() throws Exception { - PushOneCommit push = pushFactory.create(db, user.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(user.getIdent(), testRepo); PushOneCommit.Result r = push.to("refs/for/master"); r.assertOkStatus(); assertThat(r.getChange().change().getOwner()).isEqualTo(user.id); @@ -710,7 +710,7 @@ public class ChangeIT extends AbstractDaemonTest { @Test @TestProjectInput(cloneAs = "user") public void reviewWithWithWorkInProgressAdmin() throws Exception { - PushOneCommit push = pushFactory.create(db, user.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(user.getIdent(), testRepo); PushOneCommit.Result r = push.to("refs/for/master"); r.assertOkStatus(); assertThat(r.getChange().change().getOwner()).isEqualTo(user.id); @@ -754,7 +754,6 @@ public class ChangeIT extends AbstractDaemonTest { PushOneCommit push2 = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -1100,7 +1099,7 @@ public class ChangeIT extends AbstractDaemonTest { @TestProjectInput(cloneAs = "user") public void deleteNewChangeAsNormalUser() throws Exception { PushOneCommit.Result changeResult = - pushFactory.create(db, user.getIdent(), testRepo).to("refs/for/master"); + pushFactory.create(user.getIdent(), testRepo).to("refs/for/master"); String changeId = changeResult.getChangeId(); setApiUser(user); @@ -1225,7 +1224,7 @@ public class ChangeIT extends AbstractDaemonTest { @TestProjectInput(cloneAs = "user") public void deleteAbandonedChangeAsNormalUser() throws Exception { PushOneCommit.Result changeResult = - pushFactory.create(db, user.getIdent(), testRepo).to("refs/for/master"); + pushFactory.create(user.getIdent(), testRepo).to("refs/for/master"); String changeId = changeResult.getChangeId(); setApiUser(user); @@ -1240,7 +1239,7 @@ public class ChangeIT extends AbstractDaemonTest { @TestProjectInput(cloneAs = "user") public void deleteAbandonedChangeOfAnotherUserAsAdmin() throws Exception { PushOneCommit.Result changeResult = - pushFactory.create(db, user.getIdent(), testRepo).to("refs/for/master"); + pushFactory.create(user.getIdent(), testRepo).to("refs/for/master"); String changeId = changeResult.getChangeId(); gApi.changes().id(changeId).abandon(); @@ -1269,7 +1268,7 @@ public class ChangeIT extends AbstractDaemonTest { try { PushOneCommit.Result changeResult = - pushFactory.create(db, user.getIdent(), testRepo).to("refs/for/master"); + pushFactory.create(user.getIdent(), testRepo).to("refs/for/master"); String changeId = changeResult.getChangeId(); merge(changeResult); @@ -1331,7 +1330,6 @@ public class ChangeIT extends AbstractDaemonTest { PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -1488,7 +1486,7 @@ public class ChangeIT extends AbstractDaemonTest { @Test public void pushCommitOfOtherUser() throws Exception { // admin pushes commit of user - PushOneCommit push = pushFactory.create(db, user.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(user.getIdent(), testRepo); PushOneCommit.Result result = push.to("refs/for/master"); result.assertOkStatus(); @@ -1527,7 +1525,7 @@ public class ChangeIT extends AbstractDaemonTest { // admin pushes commit of user TestRepository repo = cloneProject(p, admin); - PushOneCommit push = pushFactory.create(db, user.getIdent(), repo); + PushOneCommit push = pushFactory.create(user.getIdent(), repo); PushOneCommit.Result result = push.to("refs/for/master"); result.assertOkStatus(); @@ -1558,7 +1556,6 @@ public class ChangeIT extends AbstractDaemonTest { // admin pushes commit that references 'user' in a footer PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT @@ -1603,7 +1600,6 @@ public class ChangeIT extends AbstractDaemonTest { TestRepository repo = cloneProject(p, admin); PushOneCommit push = pushFactory.create( - db, admin.getIdent(), repo, PushOneCommit.SUBJECT @@ -1645,7 +1641,7 @@ public class ChangeIT extends AbstractDaemonTest { // create change TestRepository repo = cloneProject(p, admin); - PushOneCommit push = pushFactory.create(db, admin.getIdent(), repo); + PushOneCommit push = pushFactory.create(admin.getIdent(), repo); PushOneCommit.Result result = push.to("refs/for/master"); result.assertOkStatus(); @@ -2663,8 +2659,7 @@ public class ChangeIT extends AbstractDaemonTest { r1.assertOkStatus(); PushOneCommit.Result r2 = pushFactory - .create( - db, admin.getIdent(), testRepo, SUBJECT, FILE_NAME, "new content", r1.getChangeId()) + .create(admin.getIdent(), testRepo, SUBJECT, FILE_NAME, "new content", r1.getChangeId()) .to("refs/for/master"); r2.assertOkStatus(); @@ -2839,8 +2834,7 @@ public class ChangeIT extends AbstractDaemonTest { public void noteDbCommitsOnPatchSetCreation() throws Exception { PushOneCommit.Result r = createChange(); pushFactory - .create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "4711", r.getChangeId()) + .create(admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "4711", r.getChangeId()) .to("refs/for/master") .assertOkStatus(); ChangeInfo c = gApi.changes().id(r.getChangeId()).get(); @@ -2906,7 +2900,7 @@ public class ChangeIT extends AbstractDaemonTest { block(p, "refs/for/*", Permission.ADD_PATCH_SET, REGISTERED_USERS); // Create change as admin - PushOneCommit push = pushFactory.create(db, admin.getIdent(), adminTestRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), adminTestRepo); PushOneCommit.Result r1 = push.to("refs/for/master"); r1.assertOkStatus(); @@ -2926,7 +2920,7 @@ public class ChangeIT extends AbstractDaemonTest { TestRepository userTestRepo = cloneProject(project, user); // Create change as admin - PushOneCommit push = pushFactory.create(db, admin.getIdent(), adminTestRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), adminTestRepo); PushOneCommit.Result r1 = push.to("refs/for/master"); r1.assertOkStatus(); @@ -2950,7 +2944,7 @@ public class ChangeIT extends AbstractDaemonTest { block(p, "refs/for/*", Permission.ADD_PATCH_SET, REGISTERED_USERS); // Create change as admin - PushOneCommit push = pushFactory.create(db, admin.getIdent(), adminTestRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), adminTestRepo); PushOneCommit.Result r1 = push.to("refs/for/master"); r1.assertOkStatus(); @@ -2982,7 +2976,7 @@ public class ChangeIT extends AbstractDaemonTest { createBranch("dev"); PushOneCommit.Result changeA = pushFactory - .create(db, user.getIdent(), testRepo, "change A", "A.txt", "A content") + .create(user.getIdent(), testRepo, "change A", "A.txt", "A content") .to("refs/heads/dev"); changeA.assertOkStatus(); MergeInput mergeInput = new MergeInput(); @@ -3018,7 +3012,7 @@ public class ChangeIT extends AbstractDaemonTest { createBranch("dev"); PushOneCommit.Result changeA = pushFactory - .create(db, user.getIdent(), testRepo, "change A", "A.txt", "A content") + .create(user.getIdent(), testRepo, "change A", "A.txt", "A content") .to("refs/heads/dev"); changeA.assertOkStatus(); MergeInput mergeInput = new MergeInput(); @@ -3192,7 +3186,6 @@ public class ChangeIT extends AbstractDaemonTest { testRepo.reset("config"); PushOneCommit push2 = pushFactory.create( - db, admin.getIdent(), testRepo, "Ignore Verified", @@ -3239,7 +3232,6 @@ public class ChangeIT extends AbstractDaemonTest { testRepo.reset("config"); PushOneCommit push2 = pushFactory.create( - db, admin.getIdent(), testRepo, "Configure Non-Author-Code-Review", @@ -3294,7 +3286,7 @@ public class ChangeIT extends AbstractDaemonTest { public void checkLabelsForAutoClosedChange() throws Exception { PushOneCommit.Result r = createChange(); - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); PushOneCommit.Result result = push.to("refs/heads/master"); result.assertOkStatus(); @@ -3428,10 +3420,10 @@ public class ChangeIT extends AbstractDaemonTest { String oldHead = getRemoteHead().name(); PushOneCommit.Result result1 = - pushFactory.create(db, user.getIdent(), testRepo).to("refs/for/master"); + pushFactory.create(user.getIdent(), testRepo).to("refs/for/master"); testRepo.reset(oldHead); PushOneCommit.Result result2 = - pushFactory.create(db, user.getIdent(), testRepo).to("refs/for/master"); + pushFactory.create(user.getIdent(), testRepo).to("refs/for/master"); addComment(result1, "comment 1", true, false, null); addComment(result2, "comment 2", true, true, null); @@ -3449,8 +3441,7 @@ public class ChangeIT extends AbstractDaemonTest { addPureRevertSubmitRule(); // Create a change that is not a revert of another change - PushOneCommit.Result r1 = - pushFactory.create(db, user.getIdent(), testRepo).to("refs/for/master"); + PushOneCommit.Result r1 = pushFactory.create(user.getIdent(), testRepo).to("refs/for/master"); approve(r1.getChangeId()); exception.expect(ResourceConflictException.class); @@ -3461,8 +3452,7 @@ public class ChangeIT extends AbstractDaemonTest { @Test public void pureRevertFactBlocksSubmissionOfNonPureReverts() throws Exception { - PushOneCommit.Result r1 = - pushFactory.create(db, user.getIdent(), testRepo).to("refs/for/master"); + PushOneCommit.Result r1 = pushFactory.create(user.getIdent(), testRepo).to("refs/for/master"); merge(r1); addPureRevertSubmitRule(); @@ -3481,8 +3471,7 @@ public class ChangeIT extends AbstractDaemonTest { @Test public void pureRevertFactAllowsSubmissionOfPureReverts() throws Exception { // Create a change that we can later revert - PushOneCommit.Result r1 = - pushFactory.create(db, user.getIdent(), testRepo).to("refs/for/master"); + PushOneCommit.Result r1 = pushFactory.create(user.getIdent(), testRepo).to("refs/for/master"); merge(r1); addPureRevertSubmitRule(); @@ -3580,7 +3569,7 @@ public class ChangeIT extends AbstractDaemonTest { // Block default permission block(p, "refs/for/*", Permission.ADD_PATCH_SET, REGISTERED_USERS); // Create change as user - PushOneCommit push = pushFactory.create(db, user.getIdent(), userTestRepo); + PushOneCommit push = pushFactory.create(user.getIdent(), userTestRepo); PushOneCommit.Result r = push.to("refs/for/master"); r.assertOkStatus(); // Try to change the commit message @@ -3610,7 +3599,7 @@ public class ChangeIT extends AbstractDaemonTest { String subject = "A happy change " + smile; PushOneCommit.Result r = pushFactory - .create(db, admin.getIdent(), testRepo, subject, FILE_NAME, FILE_CONTENT) + .create(admin.getIdent(), testRepo, subject, FILE_NAME, FILE_CONTENT) .to("refs/for/master"); r.assertOkStatus(); String id = r.getChangeId(); @@ -3926,7 +3915,6 @@ public class ChangeIT extends AbstractDaemonTest { public void trackingIds() throws Exception { PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT + "\n\n" + "Bug:JRA001", diff --git a/javatests/com/google/gerrit/acceptance/api/change/DisablePrivateChangesIT.java b/javatests/com/google/gerrit/acceptance/api/change/DisablePrivateChangesIT.java index ffb8b34c8a..3ae38ca4e1 100644 --- a/javatests/com/google/gerrit/acceptance/api/change/DisablePrivateChangesIT.java +++ b/javatests/com/google/gerrit/acceptance/api/change/DisablePrivateChangesIT.java @@ -54,7 +54,7 @@ public class DisablePrivateChangesIT extends AbstractDaemonTest { @GerritConfig(name = "change.disablePrivateChanges", value = "true") public void pushPrivatesWithDisablePrivateChangesTrue() throws Exception { PushOneCommit.Result result = - pushFactory.create(db, admin.getIdent(), testRepo).to("refs/for/master%private"); + pushFactory.create(admin.getIdent(), testRepo).to("refs/for/master%private"); result.assertErrorStatus(); } @@ -64,11 +64,11 @@ public class DisablePrivateChangesIT extends AbstractDaemonTest { public void pushDraftsWithDisablePrivateChangesTrue() throws Exception { RevCommit initialHead = getRemoteHead(); PushOneCommit.Result result = - pushFactory.create(db, admin.getIdent(), testRepo).to("refs/for/master%draft"); + pushFactory.create(admin.getIdent(), testRepo).to("refs/for/master%draft"); result.assertErrorStatus(); testRepo.reset(initialHead); - result = pushFactory.create(db, admin.getIdent(), testRepo).to("refs/drafts/master"); + result = pushFactory.create(admin.getIdent(), testRepo).to("refs/drafts/master"); result.assertErrorStatus(); } @@ -76,7 +76,7 @@ public class DisablePrivateChangesIT extends AbstractDaemonTest { @GerritConfig(name = "change.disablePrivateChanges", value = "true") public void pushWithDisablePrivateChangesTrue() throws Exception { PushOneCommit.Result result = - pushFactory.create(db, admin.getIdent(), testRepo).to("refs/for/master"); + pushFactory.create(admin.getIdent(), testRepo).to("refs/for/master"); result.assertOkStatus(); assertThat(result.getChange().change().isPrivate()).isFalse(); } @@ -85,7 +85,7 @@ public class DisablePrivateChangesIT extends AbstractDaemonTest { @GerritConfig(name = "change.allowDrafts", value = "true") public void pushPrivatesWithDisablePrivateChangesFalse() throws Exception { PushOneCommit.Result result = - pushFactory.create(db, admin.getIdent(), testRepo).to("refs/for/master%private"); + pushFactory.create(admin.getIdent(), testRepo).to("refs/for/master%private"); assertThat(result.getChange().change().isPrivate()).isTrue(); } @@ -94,11 +94,11 @@ public class DisablePrivateChangesIT extends AbstractDaemonTest { public void pushDraftsWithDisablePrivateChangesFalse() throws Exception { RevCommit initialHead = getRemoteHead(); PushOneCommit.Result result = - pushFactory.create(db, admin.getIdent(), testRepo).to("refs/for/master%draft"); + pushFactory.create(admin.getIdent(), testRepo).to("refs/for/master%draft"); assertThat(result.getChange().change().isPrivate()).isTrue(); testRepo.reset(initialHead); - result = pushFactory.create(db, admin.getIdent(), testRepo).to("refs/drafts/master"); + result = pushFactory.create(admin.getIdent(), testRepo).to("refs/drafts/master"); assertThat(result.getChange().change().isPrivate()).isTrue(); } diff --git a/javatests/com/google/gerrit/acceptance/api/change/MergeListIT.java b/javatests/com/google/gerrit/acceptance/api/change/MergeListIT.java index 1acd71c418..81519a7620 100644 --- a/javatests/com/google/gerrit/acceptance/api/change/MergeListIT.java +++ b/javatests/com/google/gerrit/acceptance/api/change/MergeListIT.java @@ -55,7 +55,6 @@ public class MergeListIT extends AbstractDaemonTest { PushOneCommit.Result gp1 = pushFactory .create( - db, admin.getIdent(), testRepo, "grand parent 1", @@ -66,7 +65,6 @@ public class MergeListIT extends AbstractDaemonTest { PushOneCommit.Result p1 = pushFactory .create( - db, admin.getIdent(), testRepo, "parent 1", @@ -80,7 +78,6 @@ public class MergeListIT extends AbstractDaemonTest { PushOneCommit.Result gp2 = pushFactory .create( - db, admin.getIdent(), testRepo, "grand parent 2", @@ -91,7 +88,6 @@ public class MergeListIT extends AbstractDaemonTest { PushOneCommit.Result p2 = pushFactory .create( - db, admin.getIdent(), testRepo, "parent 2", @@ -101,11 +97,7 @@ public class MergeListIT extends AbstractDaemonTest { PushOneCommit m = pushFactory.create( - db, - admin.getIdent(), - testRepo, - "merge", - ImmutableMap.of("foo", "foo-1", "bar", "bar-2")); + admin.getIdent(), testRepo, "merge", ImmutableMap.of("foo", "foo-1", "bar", "bar-2")); m.setParents(ImmutableList.of(p1.getCommit(), p2.getCommit())); PushOneCommit.Result result = m.to("refs/for/master"); result.assertOkStatus(); diff --git a/javatests/com/google/gerrit/acceptance/api/change/StickyApprovalsIT.java b/javatests/com/google/gerrit/acceptance/api/change/StickyApprovalsIT.java index b23b2bff70..81fd3d1517 100644 --- a/javatests/com/google/gerrit/acceptance/api/change/StickyApprovalsIT.java +++ b/javatests/com/google/gerrit/acceptance/api/change/StickyApprovalsIT.java @@ -444,7 +444,6 @@ public class StickyApprovalsIT extends AbstractDaemonTest { private void rework(String changeId) throws Exception { PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -460,7 +459,6 @@ public class StickyApprovalsIT extends AbstractDaemonTest { testRepo.reset(getRemoteHead()); PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, "Other Change", @@ -487,7 +485,7 @@ public class StickyApprovalsIT extends AbstractDaemonTest { testRepo.reset(parent1.getCommit()); - PushOneCommit merge = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit merge = pushFactory.create(admin.getIdent(), testRepo); merge.setParents(ImmutableList.of(parent1.getCommit(), parent2.getCommit())); PushOneCommit.Result result = merge.to("refs/for/master"); result.assertOkStatus(); @@ -504,7 +502,7 @@ public class StickyApprovalsIT extends AbstractDaemonTest { testRepo.reset(parent1); PushOneCommit.Result newParent1 = createChange("new parent 1", "p1-1.txt", "content 1-1"); - PushOneCommit merge = pushFactory.create(db, admin.getIdent(), testRepo, changeId); + PushOneCommit merge = pushFactory.create(admin.getIdent(), testRepo, changeId); merge.setParents(ImmutableList.of(newParent1.getCommit(), commitParent2)); PushOneCommit.Result result = merge.to("refs/for/master"); result.assertOkStatus(); @@ -528,7 +526,6 @@ public class StickyApprovalsIT extends AbstractDaemonTest { PushOneCommit.Result r = pushFactory .create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, diff --git a/javatests/com/google/gerrit/acceptance/api/change/SubmitTypeRuleIT.java b/javatests/com/google/gerrit/acceptance/api/change/SubmitTypeRuleIT.java index 507205d972..9517beae0a 100644 --- a/javatests/com/google/gerrit/acceptance/api/change/SubmitTypeRuleIT.java +++ b/javatests/com/google/gerrit/acceptance/api/change/SubmitTypeRuleIT.java @@ -137,7 +137,6 @@ public class SubmitTypeRuleIT extends AbstractDaemonTest { private PushOneCommit.Result createChange(String dest, String subject) throws Exception { PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, subject, diff --git a/javatests/com/google/gerrit/acceptance/api/group/GroupsIT.java b/javatests/com/google/gerrit/acceptance/api/group/GroupsIT.java index 85fbfa6f63..c57af158b1 100644 --- a/javatests/com/google/gerrit/acceptance/api/group/GroupsIT.java +++ b/javatests/com/google/gerrit/acceptance/api/group/GroupsIT.java @@ -1075,7 +1075,7 @@ public class GroupsIT extends AbstractDaemonTest { repo.reset("groupRef"); PushOneCommit.Result r = pushFactory - .create(db, admin.getIdent(), repo, "Update group", "arbitraryFile.txt", "some content") + .create(admin.getIdent(), repo, "Update group", "arbitraryFile.txt", "some content") .to(groupRefName); if (expectedErrorOnUpdate != null) { r.assertErrorStatus(expectedErrorOnUpdate); @@ -1090,7 +1090,7 @@ public class GroupsIT extends AbstractDaemonTest { TestRepository repo = cloneProject(project); PushOneCommit.Result r = pushFactory - .create(db, admin.getIdent(), repo, "Update group", "arbitraryFile.txt", "some content") + .create(admin.getIdent(), repo, "Update group", "arbitraryFile.txt", "some content") .setParents(ImmutableList.of()) .to(RefNames.REFS_GROUPS + name("bar")); r.assertOkStatus(); @@ -1128,7 +1128,7 @@ public class GroupsIT extends AbstractDaemonTest { PushOneCommit.Result r = pushFactory - .create(db, admin.getIdent(), repo, "Subject", "project.config", config) + .create(admin.getIdent(), repo, "Subject", "project.config", config) .to(RefNames.REFS_CONFIG); r.assertErrorStatus("invalid project configuration"); r.assertMessage("All-Users must inherit from All-Projects"); @@ -1178,7 +1178,7 @@ public class GroupsIT extends AbstractDaemonTest { grant(allUsers, refPattern, Permission.PUSH); TestRepository allUsersRepo = cloneProject(allUsers); - PushOneCommit.Result r = pushFactory.create(db, admin.getIdent(), allUsersRepo).to(groupRef); + PushOneCommit.Result r = pushFactory.create(admin.getIdent(), allUsersRepo).to(groupRef); r.assertErrorStatus(); assertThat(r.getMessage()).contains("Not allowed to create group branch."); @@ -1407,8 +1407,7 @@ public class GroupsIT extends AbstractDaemonTest { PushOneCommit.Result r = pushFactory - .create( - db, admin.getIdent(), repo, "Update group config", "group.config", "some content") + .create(admin.getIdent(), repo, "Update group config", "group.config", "some content") .to(MagicBranch.NEW_CHANGE + groupRef); r.assertOkStatus(); assertThat(r.getChange().change().getDest().get()).isEqualTo(groupRef); diff --git a/javatests/com/google/gerrit/acceptance/api/revision/RevisionDiffIT.java b/javatests/com/google/gerrit/acceptance/api/revision/RevisionDiffIT.java index 057f837188..b6969a2147 100644 --- a/javatests/com/google/gerrit/acceptance/api/revision/RevisionDiffIT.java +++ b/javatests/com/google/gerrit/acceptance/api/revision/RevisionDiffIT.java @@ -2521,7 +2521,7 @@ public class RevisionDiffIT extends AbstractDaemonTest { throws Exception { testRepo.reset(parentCommit); PushOneCommit push = - pushFactory.create(db, admin.getIdent(), testRepo, "Adjust files of repo", files); + pushFactory.create(admin.getIdent(), testRepo, "Adjust files of repo", files); PushOneCommit.Result result = push.to("refs/for/master"); return result.getCommit(); } @@ -2545,7 +2545,7 @@ public class RevisionDiffIT extends AbstractDaemonTest { Arrays.stream(removedFilePaths) .collect(toMap(Function.identity(), path -> "Irrelevant content")); PushOneCommit push = - pushFactory.create(db, admin.getIdent(), testRepo, "Remove files from repo", files); + pushFactory.create(admin.getIdent(), testRepo, "Remove files from repo", files); PushOneCommit.Result result = push.rm("refs/for/master"); return result.getCommit(); } @@ -2564,7 +2564,7 @@ public class RevisionDiffIT extends AbstractDaemonTest { private Result createEmptyChange() throws Exception { PushOneCommit push = - pushFactory.create(db, admin.getIdent(), testRepo, "Test change", ImmutableMap.of()); + pushFactory.create(admin.getIdent(), testRepo, "Test change", ImmutableMap.of()); return push.to("refs/for/master"); } diff --git a/javatests/com/google/gerrit/acceptance/api/revision/RevisionIT.java b/javatests/com/google/gerrit/acceptance/api/revision/RevisionIT.java index 20e6d3fff2..8438fc1616 100644 --- a/javatests/com/google/gerrit/acceptance/api/revision/RevisionIT.java +++ b/javatests/com/google/gerrit/acceptance/api/revision/RevisionIT.java @@ -419,7 +419,7 @@ public class RevisionIT extends AbstractDaemonTest { String subject = "Test change\n\nChange-Id: Ideadbeefdeadbeefdeadbeefdeadbeefdeadbeef"; PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, subject, "another_file.txt", "another content"); + admin.getIdent(), testRepo, subject, "another_file.txt", "another content"); PushOneCommit.Result r2 = push.to("refs/for/master"); // Change 2's parent should be change 1 @@ -476,7 +476,6 @@ public class RevisionIT extends AbstractDaemonTest { PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -503,7 +502,6 @@ public class RevisionIT extends AbstractDaemonTest { String destContent = "some content"; PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -515,7 +513,6 @@ public class RevisionIT extends AbstractDaemonTest { String changeContent = "another content"; push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -595,7 +592,7 @@ public class RevisionIT extends AbstractDaemonTest { public void cherryPickToExistingChange() throws Exception { PushOneCommit.Result r1 = pushFactory - .create(db, admin.getIdent(), testRepo, SUBJECT, FILE_NAME, "a") + .create(admin.getIdent(), testRepo, SUBJECT, FILE_NAME, "a") .to("refs/for/master"); String t1 = project.get() + "~master~" + r1.getChangeId(); @@ -605,7 +602,7 @@ public class RevisionIT extends AbstractDaemonTest { PushOneCommit.Result r2 = pushFactory - .create(db, admin.getIdent(), testRepo, SUBJECT, FILE_NAME, "b", r1.getChangeId()) + .create(admin.getIdent(), testRepo, SUBJECT, FILE_NAME, "b", r1.getChangeId()) .to("refs/for/foo"); String t2 = project.get() + "~foo~" + r2.getChangeId(); gApi.changes().id(t2).abandon(); @@ -920,11 +917,11 @@ public class RevisionIT extends AbstractDaemonTest { @Test public void canRebase() throws Exception { - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); PushOneCommit.Result r1 = push.to("refs/for/master"); merge(r1); - push = pushFactory.create(db, admin.getIdent(), testRepo); + push = pushFactory.create(admin.getIdent(), testRepo); PushOneCommit.Result r2 = push.to("refs/for/master"); boolean canRebase = gApi.changes().id(r2.getChangeId()).revision(r2.getCommit().name()).canRebase(); @@ -932,7 +929,7 @@ public class RevisionIT extends AbstractDaemonTest { merge(r2); testRepo.reset(r1.getCommit()); - push = pushFactory.create(db, admin.getIdent(), testRepo); + push = pushFactory.create(admin.getIdent(), testRepo); PushOneCommit.Result r3 = push.to("refs/for/master"); canRebase = gApi.changes().id(r3.getChangeId()).revision(r3.getCommit().name()).canRebase(); @@ -941,7 +938,7 @@ public class RevisionIT extends AbstractDaemonTest { @Test public void setUnsetReviewedFlag() throws Exception { - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); PushOneCommit.Result r = push.to("refs/for/master"); gApi.changes().id(r.getChangeId()).current().setReviewed(PushOneCommit.FILE_NAME, true); @@ -960,7 +957,6 @@ public class RevisionIT extends AbstractDaemonTest { PushOneCommit push1 = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -976,7 +972,6 @@ public class RevisionIT extends AbstractDaemonTest { PushOneCommit push2 = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -1096,7 +1091,7 @@ public class RevisionIT extends AbstractDaemonTest { public void queryRevisionFiles() throws Exception { Map files = ImmutableMap.of("file1.txt", "content 1", "file2.txt", "content 2"); PushOneCommit.Result result = - pushFactory.create(db, admin.getIdent(), testRepo, SUBJECT, files).to("refs/for/master"); + pushFactory.create(admin.getIdent(), testRepo, SUBJECT, files).to("refs/for/master"); result.assertOkStatus(); String changeId = result.getChangeId(); @@ -1469,7 +1464,7 @@ public class RevisionIT extends AbstractDaemonTest { throws Exception { PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, "test commit", "a.txt", content, r.getChangeId()); + admin.getIdent(), testRepo, "test commit", "a.txt", content, r.getChangeId()); return push.to("refs/for/master"); } @@ -1495,18 +1490,17 @@ public class RevisionIT extends AbstractDaemonTest { PushOneCommit.Result changeAResult = pushFactory - .create(db, admin.getIdent(), testRepo, "change a", parent1FileName, "Content of a") + .create(admin.getIdent(), testRepo, "change a", parent1FileName, "Content of a") .to("refs/for/" + branchAName); testRepo.reset(initialCommit); PushOneCommit.Result changeBResult = pushFactory - .create(db, admin.getIdent(), testRepo, "change b", parent2FileName, "Content of b") + .create(admin.getIdent(), testRepo, "change b", parent2FileName, "Content of b") .to("refs/for/" + branchBName); PushOneCommit pushableMergeCommit = pushFactory.create( - db, admin.getIdent(), testRepo, "merge", diff --git a/javatests/com/google/gerrit/acceptance/api/revision/RobotCommentsIT.java b/javatests/com/google/gerrit/acceptance/api/revision/RobotCommentsIT.java index c5251f71ea..90f0a2ac12 100644 --- a/javatests/com/google/gerrit/acceptance/api/revision/RobotCommentsIT.java +++ b/javatests/com/google/gerrit/acceptance/api/revision/RobotCommentsIT.java @@ -68,7 +68,6 @@ public class RobotCommentsIT extends AbstractDaemonTest { public void setUp() throws Exception { PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, "Provide files which can be used for fixes", @@ -107,7 +106,7 @@ public class RobotCommentsIT extends AbstractDaemonTest { RobotCommentInput in = createRobotCommentInput(); addRobotComment(changeId, in); - pushFactory.create(db, admin.getIdent(), testRepo, changeId).to("refs/for/master"); + pushFactory.create(admin.getIdent(), testRepo, changeId).to("refs/for/master"); RobotCommentInput in2 = createRobotCommentInput(); addRobotComment(changeId, in2); @@ -919,8 +918,7 @@ public class RobotCommentsIT extends AbstractDaemonTest { PushOneCommit.Result r1 = createChange(); PushOneCommit.Result r2 = pushFactory - .create( - db, admin.getIdent(), testRepo, SUBJECT, FILE_NAME, "new content", r1.getChangeId()) + .create(admin.getIdent(), testRepo, SUBJECT, FILE_NAME, "new content", r1.getChangeId()) .to("refs/for/master"); addRobotComment(r2.getChangeId(), createRobotCommentInputWithMandatoryFields()); diff --git a/javatests/com/google/gerrit/acceptance/edit/ChangeEditIT.java b/javatests/com/google/gerrit/acceptance/edit/ChangeEditIT.java index 37bfd422ae..ae649c8e81 100644 --- a/javatests/com/google/gerrit/acceptance/edit/ChangeEditIT.java +++ b/javatests/com/google/gerrit/acceptance/edit/ChangeEditIT.java @@ -285,7 +285,6 @@ public class ChangeEditIT extends AbstractDaemonTest { assertThat(edit).value().baseRevision().isEqualTo(currentPatchSet.getRevision().get()); PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -689,7 +688,7 @@ public class ChangeEditIT extends AbstractDaemonTest { block(p, "refs/for/*", Permission.ADD_PATCH_SET, REGISTERED_USERS); // Create change as user - PushOneCommit push = pushFactory.create(db, user.getIdent(), userTestRepo); + PushOneCommit push = pushFactory.create(user.getIdent(), userTestRepo); PushOneCommit.Result r1 = push.to("refs/for/master"); r1.assertOkStatus(); @@ -744,14 +743,13 @@ public class ChangeEditIT extends AbstractDaemonTest { private String newChange(PersonIdent ident) throws Exception { PushOneCommit push = pushFactory.create( - db, ident, testRepo, PushOneCommit.SUBJECT, FILE_NAME, new String(CONTENT_OLD, UTF_8)); + ident, testRepo, PushOneCommit.SUBJECT, FILE_NAME, new String(CONTENT_OLD, UTF_8)); return push.to("refs/for/master").getChangeId(); } private String amendChange(PersonIdent ident, String changeId) throws Exception { PushOneCommit push = pushFactory.create( - db, ident, testRepo, PushOneCommit.SUBJECT, @@ -764,7 +762,7 @@ public class ChangeEditIT extends AbstractDaemonTest { private String newChange2(PersonIdent ident) throws Exception { PushOneCommit push = pushFactory.create( - db, ident, testRepo, PushOneCommit.SUBJECT, FILE_NAME, new String(CONTENT_OLD, UTF_8)); + ident, testRepo, PushOneCommit.SUBJECT, FILE_NAME, new String(CONTENT_OLD, UTF_8)); return push.rm("refs/for/master").getChangeId(); } diff --git a/javatests/com/google/gerrit/acceptance/git/AbstractPushForReview.java b/javatests/com/google/gerrit/acceptance/git/AbstractPushForReview.java index 587840764d..3d3ddc3d57 100644 --- a/javatests/com/google/gerrit/acceptance/git/AbstractPushForReview.java +++ b/javatests/com/google/gerrit/acceptance/git/AbstractPushForReview.java @@ -382,7 +382,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { .create(); PushOneCommit.Result r2 = pushFactory - .create(db, admin.getIdent(), testRepo, "another commit", "b.txt", "bbb") + .create(admin.getIdent(), testRepo, "another commit", "b.txt", "bbb") .to("refs/for/master"); Change.Id id2 = r2.getChange().getId(); r2.assertOkStatus(); @@ -487,7 +487,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { List pushOptions = new ArrayList<>(); pushOptions.add(topicOption); - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); push.setPushOptions(pushOptions); PushOneCommit.Result r = push.to("refs/for/master"); @@ -830,7 +830,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { public void pushWorkInProgressChangeWhenNotOwner() throws Exception { TestRepository userRepo = cloneProject(project, user); PushOneCommit.Result r = - pushFactory.create(db, user.getIdent(), userRepo).to("refs/for/master%wip"); + pushFactory.create(user.getIdent(), userRepo).to("refs/for/master%wip"); r.assertOkStatus(); assertThat(r.getChange().change().getOwner()).isEqualTo(user.id); assertThat(r.getChange().change().isWorkInProgress()).isTrue(); @@ -847,7 +847,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { assertThat(r.getChange().change().isWorkInProgress()).isTrue(); // Push as change owner to move change from WIP to ready. - r = pushFactory.create(db, user.getIdent(), userRepo).to("refs/for/master%ready"); + r = pushFactory.create(user.getIdent(), userRepo).to("refs/for/master%ready"); r.assertOkStatus(); assertThat(r.getChange().change().isWorkInProgress()).isFalse(); @@ -929,8 +929,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { enableCreateNewChangeForAllNotInTarget(); PushOneCommit push = - pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content"); + pushFactory.create(admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content"); // %2C is comma; the value below tests that percent decoding happens after splitting. // All three ways of representing space ("%20", "+", and "_" are also exercised. PushOneCommit.Result r = push.to("refs/for/master/%m=my_test%20+_message%2Cm="); @@ -938,7 +937,6 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -1016,7 +1014,6 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -1038,7 +1035,6 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -1057,7 +1053,6 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -1232,7 +1227,6 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { r.assertOkStatus(); PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -1248,7 +1242,6 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { r.assertOkStatus(); PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -1295,7 +1288,6 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { String hashtag2 = "tag2"; PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -1328,7 +1320,6 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { String hashtag4 = "tag4"; PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -1346,7 +1337,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { public void pushCommitUsingSignedOffBy() throws Exception { PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); + admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); PushOneCommit.Result r = push.to("refs/for/master"); r.assertOkStatus(); @@ -1355,7 +1346,6 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT @@ -1367,7 +1357,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); + admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); r = push.to("refs/for/master"); r.assertErrorStatus("not Signed-off-by author/committer/uploader in message footer"); } @@ -1377,14 +1367,13 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { enableCreateNewChangeForAllNotInTarget(); PushOneCommit push = - pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content"); + pushFactory.create(admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content"); PushOneCommit.Result r = push.to("refs/for/master"); r.assertOkStatus(); push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); + admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); r = push.to("refs/for/master"); r.assertOkStatus(); @@ -1402,8 +1391,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { // create a change as admin PushOneCommit push = - pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content"); + pushFactory.create(admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content"); PushOneCommit.Result r = push.to("refs/for/master"); r.assertOkStatus(); RevCommit commitChange1 = r.getCommit(); @@ -1414,7 +1402,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { userRepo.reset("change"); push = pushFactory.create( - db, user.getIdent(), userRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); + user.getIdent(), userRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); r = push.to("refs/for/master"); r.assertOkStatus(); @@ -1432,7 +1420,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); + admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); PushOneCommit.Result r = push.to("refs/for/master"); r.assertOkStatus(); @@ -1451,14 +1439,13 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { enableCreateNewChangeForAllNotInTarget(); PushOneCommit push = - pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content"); + pushFactory.create(admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content"); PushOneCommit.Result r = push.to("refs/for/master"); r.assertOkStatus(); push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); + admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); r = push.to("refs/for/master"); r.assertOkStatus(); @@ -1473,14 +1460,13 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { enableCreateNewChangeForAllNotInTarget(); PushOneCommit push = - pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content"); + pushFactory.create(admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content"); PushOneCommit.Result r = push.to("refs/for/master"); r.assertOkStatus(); push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); + admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); r = push.to("refs/for/master"); r.assertOkStatus(); @@ -1588,7 +1574,6 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { r.assertOkStatus(); PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT @@ -1684,8 +1669,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { @Test public void pushCommitWithSameChangeIdAsPredecessorChange() throws Exception { PushOneCommit push = - pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content"); + pushFactory.create(admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content"); PushOneCommit.Result r = push.to("refs/for/master"); r.assertOkStatus(); RevCommit commitChange1 = r.getCommit(); @@ -1820,7 +1804,7 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { public void forcePushAbandonedChange() throws Exception { grant(project, "refs/*", Permission.PUSH, true); PushOneCommit push1 = - pushFactory.create(db, admin.getIdent(), testRepo, "change1", "a.txt", "content"); + pushFactory.create(admin.getIdent(), testRepo, "change1", "a.txt", "content"); PushOneCommit.Result r = push1.to("refs/for/master"); r.assertOkStatus(); @@ -1901,7 +1885,6 @@ public abstract class AbstractPushForReview extends AbstractDaemonTest { r.assertOkStatus(); PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, diff --git a/javatests/com/google/gerrit/acceptance/git/ForcePushIT.java b/javatests/com/google/gerrit/acceptance/git/ForcePushIT.java index d80faa8ee1..652a83671e 100644 --- a/javatests/com/google/gerrit/acceptance/git/ForcePushIT.java +++ b/javatests/com/google/gerrit/acceptance/git/ForcePushIT.java @@ -38,7 +38,7 @@ public class ForcePushIT extends AbstractDaemonTest { public void forcePushNotAllowed() throws Exception { ObjectId initial = repo().exactRef(HEAD).getLeaf().getObjectId(); PushOneCommit push1 = - pushFactory.create(db, admin.getIdent(), testRepo, "change1", "a.txt", "content"); + pushFactory.create(admin.getIdent(), testRepo, "change1", "a.txt", "content"); PushOneCommit.Result r1 = push1.to("refs/heads/master"); r1.assertOkStatus(); @@ -48,7 +48,7 @@ public class ForcePushIT extends AbstractDaemonTest { assertThat(ru.forceUpdate()).isEqualTo(RefUpdate.Result.FORCED); PushOneCommit push2 = - pushFactory.create(db, admin.getIdent(), testRepo, "change2", "b.txt", "content"); + pushFactory.create(admin.getIdent(), testRepo, "change2", "b.txt", "content"); push2.setForce(true); PushOneCommit.Result r2 = push2.to("refs/heads/master"); r2.assertErrorStatus("not permitted: force update"); @@ -59,7 +59,7 @@ public class ForcePushIT extends AbstractDaemonTest { ObjectId initial = repo().exactRef(HEAD).getLeaf().getObjectId(); grant(project, "refs/*", Permission.PUSH, true); PushOneCommit push1 = - pushFactory.create(db, admin.getIdent(), testRepo, "change1", "a.txt", "content"); + pushFactory.create(admin.getIdent(), testRepo, "change1", "a.txt", "content"); PushOneCommit.Result r1 = push1.to("refs/heads/master"); r1.assertOkStatus(); @@ -69,7 +69,7 @@ public class ForcePushIT extends AbstractDaemonTest { assertThat(ru.forceUpdate()).isEqualTo(RefUpdate.Result.FORCED); PushOneCommit push2 = - pushFactory.create(db, admin.getIdent(), testRepo, "change2", "b.txt", "content"); + pushFactory.create(admin.getIdent(), testRepo, "change2", "b.txt", "content"); push2.setForce(true); PushOneCommit.Result r2 = push2.to("refs/heads/master"); r2.assertOkStatus(); diff --git a/javatests/com/google/gerrit/acceptance/git/ImplicitMergeCheckIT.java b/javatests/com/google/gerrit/acceptance/git/ImplicitMergeCheckIT.java index 954ca8b0d9..eed506c87b 100644 --- a/javatests/com/google/gerrit/acceptance/git/ImplicitMergeCheckIT.java +++ b/javatests/com/google/gerrit/acceptance/git/ImplicitMergeCheckIT.java @@ -91,8 +91,7 @@ public class ImplicitMergeCheckIT extends AbstractDaemonTest { private PushOneCommit.Result push(String ref, String subject, String fileName, String content) throws Exception { - PushOneCommit push = - pushFactory.create(db, admin.getIdent(), testRepo, subject, fileName, content); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo, subject, fileName, content); return push.to(ref); } } diff --git a/javatests/com/google/gerrit/acceptance/git/RefAdvertisementIT.java b/javatests/com/google/gerrit/acceptance/git/RefAdvertisementIT.java index aa03d90527..d2c86ab894 100644 --- a/javatests/com/google/gerrit/acceptance/git/RefAdvertisementIT.java +++ b/javatests/com/google/gerrit/acceptance/git/RefAdvertisementIT.java @@ -138,22 +138,22 @@ public class RefAdvertisementIT extends AbstractDaemonTest { // visible. allow("refs/for/refs/heads/*", Permission.SUBMIT, admins); PushOneCommit.Result mr = - pushFactory.create(db, admin.getIdent(), testRepo).to("refs/for/master%submit"); + pushFactory.create(admin.getIdent(), testRepo).to("refs/for/master%submit"); mr.assertOkStatus(); c1 = mr.getChange(); r1 = changeRefPrefix(c1.getId()); PushOneCommit.Result br = - pushFactory.create(db, admin.getIdent(), testRepo).to("refs/for/branch%submit"); + pushFactory.create(admin.getIdent(), testRepo).to("refs/for/branch%submit"); br.assertOkStatus(); c2 = br.getChange(); r2 = changeRefPrefix(c2.getId()); // Second 2 changes are unmerged. - mr = pushFactory.create(db, admin.getIdent(), testRepo).to("refs/for/master"); + mr = pushFactory.create(admin.getIdent(), testRepo).to("refs/for/master"); mr.assertOkStatus(); c3 = mr.getChange(); r3 = changeRefPrefix(c3.getId()); - br = pushFactory.create(db, admin.getIdent(), testRepo).to("refs/for/branch"); + br = pushFactory.create(admin.getIdent(), testRepo).to("refs/for/branch"); br.assertOkStatus(); c4 = br.getChange(); r4 = changeRefPrefix(c4.getId()); @@ -675,7 +675,7 @@ public class RefAdvertisementIT extends AbstractDaemonTest { allUsersRepo.reset("userRef"); PushOneCommit.Result mr = pushFactory - .create(db, admin.getIdent(), allUsersRepo) + .create(admin.getIdent(), allUsersRepo) .to("refs/for/" + RefNames.REFS_USERS_SELF); mr.assertOkStatus(); diff --git a/javatests/com/google/gerrit/acceptance/git/SubmitOnPushIT.java b/javatests/com/google/gerrit/acceptance/git/SubmitOnPushIT.java index dd9f08f1fd..fd6d83520d 100644 --- a/javatests/com/google/gerrit/acceptance/git/SubmitOnPushIT.java +++ b/javatests/com/google/gerrit/acceptance/git/SubmitOnPushIT.java @@ -218,7 +218,6 @@ public class SubmitOnPushIT extends AbstractDaemonTest { PushOneCommit push = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, @@ -352,8 +351,7 @@ public class SubmitOnPushIT extends AbstractDaemonTest { private PushOneCommit.Result push(String ref, String subject, String fileName, String content) throws Exception { - PushOneCommit push = - pushFactory.create(db, admin.getIdent(), testRepo, subject, fileName, content); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo, subject, fileName, content); return push.to(ref); } @@ -361,7 +359,7 @@ public class SubmitOnPushIT extends AbstractDaemonTest { String ref, String subject, String fileName, String content, String changeId) throws Exception { PushOneCommit push = - pushFactory.create(db, admin.getIdent(), testRepo, subject, fileName, content, changeId); + pushFactory.create(admin.getIdent(), testRepo, subject, fileName, content, changeId); return push.to(ref); } } diff --git a/javatests/com/google/gerrit/acceptance/git/SubmoduleSubscriptionsIT.java b/javatests/com/google/gerrit/acceptance/git/SubmoduleSubscriptionsIT.java index 72ba420ade..e422c95d43 100644 --- a/javatests/com/google/gerrit/acceptance/git/SubmoduleSubscriptionsIT.java +++ b/javatests/com/google/gerrit/acceptance/git/SubmoduleSubscriptionsIT.java @@ -581,7 +581,7 @@ public class SubmoduleSubscriptionsIT extends AbstractSubmoduleSubscription { // Create change as user. PushOneCommit push = - pushFactory.create(db, user.getIdent(), repo2, "Change 2", "b.txt", "other content"); + pushFactory.create(user.getIdent(), repo2, "Change 2", "b.txt", "other content"); PushOneCommit.Result pushResult2 = push.to("refs/for/master/" + name(topic)); approve(pushResult2.getChangeId()); diff --git a/javatests/com/google/gerrit/acceptance/rest/TraceIT.java b/javatests/com/google/gerrit/acceptance/rest/TraceIT.java index 137dc21e5d..0a5510a40f 100644 --- a/javatests/com/google/gerrit/acceptance/rest/TraceIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/TraceIT.java @@ -171,7 +171,7 @@ public class TraceIT extends AbstractDaemonTest { @Test public void pushWithoutTrace() throws Exception { - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); PushOneCommit.Result r = push.to("refs/heads/master"); r.assertOkStatus(); assertThat(commitValidationListener.traceId).isNull(); @@ -180,7 +180,7 @@ public class TraceIT extends AbstractDaemonTest { @Test public void pushWithTrace() throws Exception { - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); push.setPushOptions(ImmutableList.of("trace")); PushOneCommit.Result r = push.to("refs/heads/master"); r.assertOkStatus(); @@ -190,7 +190,7 @@ public class TraceIT extends AbstractDaemonTest { @Test public void pushWithTraceAndProvidedTraceId() throws Exception { - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); push.setPushOptions(ImmutableList.of("trace=issue/123")); PushOneCommit.Result r = push.to("refs/heads/master"); r.assertOkStatus(); @@ -200,7 +200,7 @@ public class TraceIT extends AbstractDaemonTest { @Test public void pushForReviewWithoutTrace() throws Exception { - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); PushOneCommit.Result r = push.to("refs/for/master"); r.assertOkStatus(); assertThat(commitValidationListener.traceId).isNull(); @@ -209,7 +209,7 @@ public class TraceIT extends AbstractDaemonTest { @Test public void pushForReviewWithTrace() throws Exception { - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); push.setPushOptions(ImmutableList.of("trace")); PushOneCommit.Result r = push.to("refs/for/master"); r.assertOkStatus(); @@ -219,7 +219,7 @@ public class TraceIT extends AbstractDaemonTest { @Test public void pushForReviewWithTraceAndProvidedTraceId() throws Exception { - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); push.setPushOptions(ImmutableList.of("trace=issue/123")); PushOneCommit.Result r = push.to("refs/for/master"); r.assertOkStatus(); diff --git a/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmit.java b/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmit.java index 8bfcc84ddd..a06bd95531 100644 --- a/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmit.java +++ b/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmit.java @@ -320,7 +320,7 @@ public abstract class AbstractSubmit extends AbstractDaemonTest { block(p, "refs/*", Permission.SUBMIT, REGISTERED_USERS); TestRepository repo = cloneProject(p, admin); - PushOneCommit push = pushFactory.create(db, admin.getIdent(), repo); + PushOneCommit push = pushFactory.create(admin.getIdent(), repo); PushOneCommit.Result result = push.to("refs/for/master"); result.assertOkStatus(); @@ -340,7 +340,7 @@ public abstract class AbstractSubmit extends AbstractDaemonTest { } TestRepository repo = cloneProject(p, admin); - PushOneCommit push = pushFactory.create(db, admin.getIdent(), repo); + PushOneCommit push = pushFactory.create(admin.getIdent(), repo); PushOneCommit.Result result = push.to("refs/for/master"); result.assertOkStatus(); @@ -366,7 +366,7 @@ public abstract class AbstractSubmit extends AbstractDaemonTest { } TestRepository repo = cloneProject(p, admin); - PushOneCommit push = pushFactory.create(db, admin.getIdent(), repo); + PushOneCommit push = pushFactory.create(admin.getIdent(), repo); PushOneCommit.Result result = push.to("refs/for/master"); result.assertOkStatus(); @@ -587,13 +587,12 @@ public abstract class AbstractSubmit extends AbstractDaemonTest { } PushOneCommit push1 = - pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content"); + pushFactory.create(admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "a.txt", "content"); PushOneCommit.Result c1 = push1.to("refs/heads/topic"); c1.assertOkStatus(); PushOneCommit push2 = pushFactory.create( - db, admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); + admin.getIdent(), testRepo, PushOneCommit.SUBJECT, "b.txt", "anotherContent"); PushOneCommit.Result c2 = push2.to("refs/heads/topic"); c2.assertOkStatus(); @@ -617,11 +616,10 @@ public abstract class AbstractSubmit extends AbstractDaemonTest { // RevCommit master = getRemoteHead(project, "master"); PushOneCommit stableTip = - pushFactory.create( - db, admin.getIdent(), testRepo, "Tip of branch stable", "stable.txt", ""); + pushFactory.create(admin.getIdent(), testRepo, "Tip of branch stable", "stable.txt", ""); PushOneCommit.Result stable = stableTip.to("refs/heads/stable"); PushOneCommit mergeCommit = - pushFactory.create(db, admin.getIdent(), testRepo, "The merge commit", "merge.txt", ""); + pushFactory.create(admin.getIdent(), testRepo, "The merge commit", "merge.txt", ""); mergeCommit.setParents(ImmutableList.of(master, stable.getCommit())); PushOneCommit.Result mergeReview = mergeCommit.to("refs/for/master"); approve(mergeReview.getChangeId()); @@ -648,11 +646,11 @@ public abstract class AbstractSubmit extends AbstractDaemonTest { // push directly to stable to S1 PushOneCommit.Result s1 = pushFactory - .create(db, admin.getIdent(), testRepo, "new commit into stable", "stable1.txt", "") + .create(admin.getIdent(), testRepo, "new commit into stable", "stable1.txt", "") .to("refs/heads/stable"); // move the stable tip ahead to S2 pushFactory - .create(db, admin.getIdent(), testRepo, "Tip of branch stable", "stable2.txt", "") + .create(admin.getIdent(), testRepo, "Tip of branch stable", "stable2.txt", "") .to("refs/heads/stable"); testRepo.reset(initial); @@ -660,12 +658,12 @@ public abstract class AbstractSubmit extends AbstractDaemonTest { // move the master ahead PushOneCommit.Result m = pushFactory - .create(db, admin.getIdent(), testRepo, "Move master ahead", "master.txt", "") + .create(admin.getIdent(), testRepo, "Move master ahead", "master.txt", "") .to("refs/heads/master"); // create merge change PushOneCommit mc = - pushFactory.create(db, admin.getIdent(), testRepo, "The merge commit", "merge.txt", ""); + pushFactory.create(admin.getIdent(), testRepo, "The merge commit", "merge.txt", ""); mc.setParents(ImmutableList.of(m.getCommit(), s1.getCommit())); PushOneCommit.Result mergeReview = mc.to("refs/for/master"); approve(mergeReview.getChangeId()); @@ -841,7 +839,7 @@ public abstract class AbstractSubmit extends AbstractDaemonTest { // Create a stable branch and bootstrap it. gApi.projects().name(project.get()).branch("stable").create(new BranchInput()); PushOneCommit push = - pushFactory.create(db, user.getIdent(), testRepo, "initial commit", "a.txt", "a"); + pushFactory.create(user.getIdent(), testRepo, "initial commit", "a.txt", "a"); PushOneCommit.Result change = push.to("refs/heads/stable"); RevCommit stable = getRemoteHead(project, "stable"); @@ -1096,7 +1094,7 @@ public abstract class AbstractSubmit extends AbstractDaemonTest { assertThat(getRemoteHead()).isNull(); PushOneCommit.Result change = pushFactory - .create(db, admin.getIdent(), testRepo, "Change 1", ImmutableMap.of()) + .create(admin.getIdent(), testRepo, "Change 1", ImmutableMap.of()) .to("refs/for/master"); change.assertOkStatus(); // TODO(dborowitz): Use EMPTY_TREE_ID after upgrading to https://git.eclipse.org/r/127473 @@ -1365,8 +1363,7 @@ public abstract class AbstractSubmit extends AbstractDaemonTest { protected PushOneCommit.Result createChange( String subject, String fileName, String content, String topic) throws Exception { - PushOneCommit push = - pushFactory.create(db, admin.getIdent(), testRepo, subject, fileName, content); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo, subject, fileName, content); return push.to("refs/for/master/" + name(topic)); } } diff --git a/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmitByMerge.java b/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmitByMerge.java index fecb6c5197..21d07a766e 100644 --- a/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmitByMerge.java +++ b/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmitByMerge.java @@ -97,10 +97,10 @@ public abstract class AbstractSubmitByMerge extends AbstractSubmit { assume().that(isSubmitWholeTopicEnabled()).isTrue(); PushOneCommit.Result change1 = pushFactory - .create(db, admin.getIdent(), testRepo, "Change 1", "a", "a") + .create(admin.getIdent(), testRepo, "Change 1", "a", "a") .to("refs/for/master/" + name("topic")); - PushOneCommit push2 = pushFactory.create(db, admin.getIdent(), testRepo, "Change 2", "b", "b"); + PushOneCommit push2 = pushFactory.create(admin.getIdent(), testRepo, "Change 2", "b", "b"); push2.noParents(); PushOneCommit.Result change2 = push2.to("refs/for/master/" + name("topic")); change2.assertOkStatus(); diff --git a/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmitByRebase.java b/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmitByRebase.java index e8e896d872..21ab4c43d5 100644 --- a/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmitByRebase.java +++ b/javatests/com/google/gerrit/acceptance/rest/change/AbstractSubmitByRebase.java @@ -174,7 +174,7 @@ public abstract class AbstractSubmitByRebase extends AbstractSubmit { PushOneCommit.Result change1 = createChange("Added a", "a.txt", ""); PushOneCommit change2Push = - pushFactory.create(db, admin.getIdent(), testRepo, "Merge to master", "m.txt", ""); + pushFactory.create(admin.getIdent(), testRepo, "Merge to master", "m.txt", ""); change2Push.setParents(ImmutableList.of(initialHead, change1.getCommit())); PushOneCommit.Result change2 = change2Push.to("refs/for/master"); diff --git a/javatests/com/google/gerrit/acceptance/rest/change/ChangeOwnerIT.java b/javatests/com/google/gerrit/acceptance/rest/change/ChangeOwnerIT.java index 164fe6040a..73416ee1f2 100644 --- a/javatests/com/google/gerrit/acceptance/rest/change/ChangeOwnerIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/change/ChangeOwnerIT.java @@ -145,7 +145,7 @@ public class ChangeOwnerIT extends AbstractDaemonTest { } private String createMyChange(TestRepository testRepo) throws Exception { - PushOneCommit push = pushFactory.create(db, user.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(user.getIdent(), testRepo); return push.to("refs/for/master").getChangeId(); } } diff --git a/javatests/com/google/gerrit/acceptance/rest/change/ConfigChangeIT.java b/javatests/com/google/gerrit/acceptance/rest/change/ConfigChangeIT.java index c5ba5e4451..29946b4f31 100644 --- a/javatests/com/google/gerrit/acceptance/rest/change/ConfigChangeIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/change/ConfigChangeIT.java @@ -164,7 +164,7 @@ public class ConfigChangeIT extends AbstractDaemonTest { GitUtil.fetch(childRepo, RefNames.REFS_CONFIG + ":cfg"); childRepo.reset("cfg"); PushOneCommit push = - pushFactory.create(db, admin.getIdent(), childRepo, "Subject", "project.config", config); + pushFactory.create(admin.getIdent(), childRepo, "Subject", "project.config", config); PushOneCommit.Result res = push.to(RefNames.REFS_CONFIG); res.assertErrorStatus(); res.assertMessage("cannot inherit from multiple projects"); @@ -190,12 +190,7 @@ public class ConfigChangeIT extends AbstractDaemonTest { PushOneCommit.Result r = pushFactory .create( - db, - user.getIdent(), - testRepo, - "Update project config", - "project.config", - cfg.toText()) + user.getIdent(), testRepo, "Update project config", "project.config", cfg.toText()) .to("refs/for/refs/meta/config"); r.assertOkStatus(); return r; diff --git a/javatests/com/google/gerrit/acceptance/rest/change/CreateChangeIT.java b/javatests/com/google/gerrit/acceptance/rest/change/CreateChangeIT.java index 28252e58fd..66e429aafc 100644 --- a/javatests/com/google/gerrit/acceptance/rest/change/CreateChangeIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/change/CreateChangeIT.java @@ -536,7 +536,7 @@ public class CreateChangeIT extends AbstractDaemonTest { // create a initial commit in master Result initialCommit = pushFactory - .create(db, user.getIdent(), testRepo, "initial commit", "readme.txt", "initial commit") + .create(user.getIdent(), testRepo, "initial commit", "readme.txt", "initial commit") .to("refs/heads/master"); initialCommit.assertOkStatus(); @@ -547,13 +547,13 @@ public class CreateChangeIT extends AbstractDaemonTest { // create a commit in branchA Result changeA = pushFactory - .create(db, user.getIdent(), testRepo, "change A", fileA, "A content") + .create(user.getIdent(), testRepo, "change A", fileA, "A content") .to("refs/heads/" + branchA); changeA.assertOkStatus(); // create a commit in branchB PushOneCommit commitB = - pushFactory.create(db, user.getIdent(), testRepo, "change B", fileB, "B content"); + pushFactory.create(user.getIdent(), testRepo, "change B", fileB, "B content"); commitB.setParent(initialCommit.getCommit()); Result changeB = commitB.to("refs/heads/" + branchB); changeB.assertOkStatus(); diff --git a/javatests/com/google/gerrit/acceptance/rest/change/IndexChangeIT.java b/javatests/com/google/gerrit/acceptance/rest/change/IndexChangeIT.java index 7cdd266604..f4afc37904 100644 --- a/javatests/com/google/gerrit/acceptance/rest/change/IndexChangeIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/change/IndexChangeIT.java @@ -73,7 +73,7 @@ public class IndexChangeIT extends AbstractDaemonTest { // Clone it and push a change as a regular user TestRepository repo = cloneProject(p, user); - PushOneCommit push = pushFactory.create(db, user.getIdent(), repo); + PushOneCommit push = pushFactory.create(user.getIdent(), repo); PushOneCommit.Result result = push.to("refs/for/master"); result.assertOkStatus(); assertThat(result.getChange().change().getOwner()).isEqualTo(user.id); diff --git a/javatests/com/google/gerrit/acceptance/rest/change/ListChangesOptionsIT.java b/javatests/com/google/gerrit/acceptance/rest/change/ListChangesOptionsIT.java index 174280d3e3..ae6c14c4d0 100644 --- a/javatests/com/google/gerrit/acceptance/rest/change/ListChangesOptionsIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/change/ListChangesOptionsIT.java @@ -48,8 +48,7 @@ public class ListChangesOptionsIT extends AbstractDaemonTest { String subject = "Change subject"; String fileName = "a.txt"; PushOneCommit push = - pushFactory.create( - db, admin.getIdent(), testRepo, subject, fileName, content, baseChangeId); + pushFactory.create(admin.getIdent(), testRepo, subject, fileName, content, baseChangeId); PushOneCommit.Result r = push.to("refs/for/master"); r.assertOkStatus(); return r; diff --git a/javatests/com/google/gerrit/acceptance/rest/change/MoveChangeIT.java b/javatests/com/google/gerrit/acceptance/rest/change/MoveChangeIT.java index 222973ec50..8d12886301 100644 --- a/javatests/com/google/gerrit/acceptance/rest/change/MoveChangeIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/change/MoveChangeIT.java @@ -360,7 +360,7 @@ public class MoveChangeIT extends AbstractDaemonTest { } private PushOneCommit.Result createChange(String branch, String changeId) throws Exception { - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo, changeId); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo, changeId); PushOneCommit.Result result = push.to("refs/for/" + branch); result.assertOkStatus(); return result; diff --git a/javatests/com/google/gerrit/acceptance/rest/change/PrivateByDefaultIT.java b/javatests/com/google/gerrit/acceptance/rest/change/PrivateByDefaultIT.java index c2d38172cc..82fc426a93 100644 --- a/javatests/com/google/gerrit/acceptance/rest/change/PrivateByDefaultIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/change/PrivateByDefaultIT.java @@ -121,7 +121,7 @@ public class PrivateByDefaultIT extends AbstractDaemonTest { TestRepository testRepo = cloneProject(project2); PushOneCommit.Result result = - pushFactory.create(db, admin.getIdent(), testRepo).to("refs/for/master%private"); + pushFactory.create(admin.getIdent(), testRepo).to("refs/for/master%private"); result.assertErrorStatus(); } @@ -133,11 +133,11 @@ public class PrivateByDefaultIT extends AbstractDaemonTest { RevCommit initialHead = getRemoteHead(project2, "master"); TestRepository testRepo = cloneProject(project2); PushOneCommit.Result result = - pushFactory.create(db, admin.getIdent(), testRepo).to("refs/for/master%draft"); + pushFactory.create(admin.getIdent(), testRepo).to("refs/for/master%draft"); result.assertErrorStatus(); testRepo.reset(initialHead); - result = pushFactory.create(db, admin.getIdent(), testRepo).to("refs/drafts/master"); + result = pushFactory.create(admin.getIdent(), testRepo).to("refs/drafts/master"); result.assertErrorStatus(); } @@ -154,7 +154,7 @@ public class PrivateByDefaultIT extends AbstractDaemonTest { private PushOneCommit.Result createChange(Project.NameKey proj, String ref) throws Exception { TestRepository testRepo = cloneProject(proj); - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); PushOneCommit.Result result = push.to(ref); result.assertOkStatus(); return result; diff --git a/javatests/com/google/gerrit/acceptance/rest/change/SubmitByMergeIfNecessaryIT.java b/javatests/com/google/gerrit/acceptance/rest/change/SubmitByMergeIfNecessaryIT.java index d92cf303df..a757044650 100644 --- a/javatests/com/google/gerrit/acceptance/rest/change/SubmitByMergeIfNecessaryIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/change/SubmitByMergeIfNecessaryIT.java @@ -443,8 +443,7 @@ public class SubmitByMergeIfNecessaryIT extends AbstractSubmitByMerge { gApi.projects().name(project.get()).branch("stable").create(new BranchInput()); // Push a change to master - PushOneCommit push = - pushFactory.create(db, user.getIdent(), testRepo, "small fix", "a.txt", "2"); + PushOneCommit push = pushFactory.create(user.getIdent(), testRepo, "small fix", "a.txt", "2"); PushOneCommit.Result change = push.to("refs/for/master"); submit(change.getChangeId()); RevCommit headAfterFirstSubmit = getRemoteLog(project, "master").get(0); @@ -496,8 +495,7 @@ public class SubmitByMergeIfNecessaryIT extends AbstractSubmitByMerge { gApi.projects().name(project.get()).branch("stable").create(new BranchInput()); // Propose a change for master, but leave it open for master! - PushOneCommit change = - pushFactory.create(db, user.getIdent(), testRepo, "small fix", "a.txt", "2"); + PushOneCommit change = pushFactory.create(user.getIdent(), testRepo, "small fix", "a.txt", "2"); PushOneCommit.Result change2result = change.to("refs/for/master"); // Now cherry pick to stable @@ -534,13 +532,13 @@ public class SubmitByMergeIfNecessaryIT extends AbstractSubmitByMerge { @Test public void dependencyOnOutdatedPatchSetPreventsMerge() throws Exception { // Create a change - PushOneCommit change = pushFactory.create(db, user.getIdent(), testRepo, "fix", "a.txt", "foo"); + PushOneCommit change = pushFactory.create(user.getIdent(), testRepo, "fix", "a.txt", "foo"); PushOneCommit.Result changeResult = change.to("refs/for/master"); PatchSet.Id patchSetId = changeResult.getPatchSetId(); // Create a successor change. PushOneCommit change2 = - pushFactory.create(db, user.getIdent(), testRepo, "feature", "b.txt", "bar"); + pushFactory.create(user.getIdent(), testRepo, "feature", "b.txt", "bar"); PushOneCommit.Result change2Result = change2.to("refs/for/master"); // Create new patch set for first change. @@ -576,12 +574,12 @@ public class SubmitByMergeIfNecessaryIT extends AbstractSubmitByMerge { @Test public void dependencyOnDeletedChangePreventsMerge() throws Exception { // Create a change - PushOneCommit change = pushFactory.create(db, user.getIdent(), testRepo, "fix", "a.txt", "foo"); + PushOneCommit change = pushFactory.create(user.getIdent(), testRepo, "fix", "a.txt", "foo"); PushOneCommit.Result changeResult = change.to("refs/for/master"); // Create a successor change. PushOneCommit change2 = - pushFactory.create(db, user.getIdent(), testRepo, "feature", "b.txt", "bar"); + pushFactory.create(user.getIdent(), testRepo, "feature", "b.txt", "bar"); PushOneCommit.Result change2Result = change2.to("refs/for/master"); // Delete first change. @@ -611,14 +609,13 @@ public class SubmitByMergeIfNecessaryIT extends AbstractSubmitByMerge { grant(project, "refs/*", Permission.SUBMIT, false, REGISTERED_USERS); // Create a change - PushOneCommit change = - pushFactory.create(db, admin.getIdent(), testRepo, "fix", "a.txt", "foo"); + PushOneCommit change = pushFactory.create(admin.getIdent(), testRepo, "fix", "a.txt", "foo"); PushOneCommit.Result changeResult = change.to("refs/for/master"); approve(changeResult.getChangeId()); // Create a successor change. PushOneCommit change2 = - pushFactory.create(db, admin.getIdent(), testRepo, "feature", "b.txt", "bar"); + pushFactory.create(admin.getIdent(), testRepo, "feature", "b.txt", "bar"); PushOneCommit.Result change2Result = change2.to("refs/for/master"); // Move the first change to a destination branch that is non-visible to user so that user cannot @@ -665,14 +662,13 @@ public class SubmitByMergeIfNecessaryIT extends AbstractSubmitByMerge { grant(project, "refs/*", Permission.SUBMIT, false, REGISTERED_USERS); // Create a change - PushOneCommit change = - pushFactory.create(db, admin.getIdent(), testRepo, "fix", "a.txt", "foo"); + PushOneCommit change = pushFactory.create(admin.getIdent(), testRepo, "fix", "a.txt", "foo"); PushOneCommit.Result changeResult = change.to("refs/for/master"); approve(changeResult.getChangeId()); // Create a successor change. PushOneCommit change2 = - pushFactory.create(db, admin.getIdent(), testRepo, "feature", "b.txt", "bar"); + pushFactory.create(admin.getIdent(), testRepo, "feature", "b.txt", "bar"); PushOneCommit.Result change2Result = change2.to("refs/for/master"); approve(change2Result.getChangeId()); @@ -728,8 +724,7 @@ public class SubmitByMergeIfNecessaryIT extends AbstractSubmitByMerge { createChange(repo1, "master", "A fresh change in repo1", "a.txt", "1", "topic-to-submit"); approve(change1.getChangeId()); PushOneCommit push = - pushFactory.create( - db, admin.getIdent(), repo2, "An ancestor change in repo2", "a.txt", "2"); + pushFactory.create(admin.getIdent(), repo2, "An ancestor change in repo2", "a.txt", "2"); PushOneCommit.Result change2a = push.to("refs/for/master"); approve(change2a.getChangeId()); PushOneCommit.Result change2b = diff --git a/javatests/com/google/gerrit/acceptance/rest/change/SubmitResolvingMergeCommitIT.java b/javatests/com/google/gerrit/acceptance/rest/change/SubmitResolvingMergeCommitIT.java index e9ac07a481..b1db9f0c81 100644 --- a/javatests/com/google/gerrit/acceptance/rest/change/SubmitResolvingMergeCommitIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/change/SubmitResolvingMergeCommitIT.java @@ -333,7 +333,7 @@ public class SubmitResolvingMergeCommitIT extends AbstractDaemonTest { List parents, String ref) throws Exception { - PushOneCommit push = pushFactory.create(db, admin.getIdent(), repo, subject, fileName, content); + PushOneCommit push = pushFactory.create(admin.getIdent(), repo, subject, fileName, content); if (!parents.isEmpty()) { push.setParents(parents); diff --git a/javatests/com/google/gerrit/acceptance/rest/change/WorkInProgressByDefaultIT.java b/javatests/com/google/gerrit/acceptance/rest/change/WorkInProgressByDefaultIT.java index e2fc14f4ce..02e82d85e9 100644 --- a/javatests/com/google/gerrit/acceptance/rest/change/WorkInProgressByDefaultIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/change/WorkInProgressByDefaultIT.java @@ -153,7 +153,7 @@ public class WorkInProgressByDefaultIT extends AbstractDaemonTest { private PushOneCommit.Result createChange(Project.NameKey p, String r) throws Exception { TestRepository testRepo = cloneProject(p); - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); PushOneCommit.Result result = push.to(r); result.assertOkStatus(); return result; diff --git a/javatests/com/google/gerrit/acceptance/rest/project/AccessIT.java b/javatests/com/google/gerrit/acceptance/rest/project/AccessIT.java index e6882160c2..2c24298929 100644 --- a/javatests/com/google/gerrit/acceptance/rest/project/AccessIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/project/AccessIT.java @@ -571,7 +571,7 @@ public class AccessIT extends AbstractDaemonTest { config = cfg.toText(); PushOneCommit push = pushFactory.create( - db, admin.getIdent(), allProjectsRepo, "Subject", ProjectConfig.PROJECT_CONFIG, config); + admin.getIdent(), allProjectsRepo, "Subject", ProjectConfig.PROJECT_CONFIG, config); push.to(RefNames.REFS_CONFIG).assertOkStatus(); // Verify that unknownPermission is present diff --git a/javatests/com/google/gerrit/acceptance/rest/project/GetCommitIT.java b/javatests/com/google/gerrit/acceptance/rest/project/GetCommitIT.java index 0632221431..196345543e 100644 --- a/javatests/com/google/gerrit/acceptance/rest/project/GetCommitIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/project/GetCommitIT.java @@ -85,8 +85,7 @@ public class GetCommitIT extends AbstractDaemonTest { @Test public void getOpenChange_Found() throws Exception { unblockRead(); - PushOneCommit.Result r = - pushFactory.create(db, admin.getIdent(), testRepo).to("refs/for/master"); + PushOneCommit.Result r = pushFactory.create(admin.getIdent(), testRepo).to("refs/for/master"); r.assertOkStatus(); CommitInfo info = getCommit(r.getCommit()); @@ -108,8 +107,7 @@ public class GetCommitIT extends AbstractDaemonTest { @Test public void getOpenChange_NotFound() throws Exception { - PushOneCommit.Result r = - pushFactory.create(db, admin.getIdent(), testRepo).to("refs/for/master"); + PushOneCommit.Result r = pushFactory.create(admin.getIdent(), testRepo).to("refs/for/master"); r.assertOkStatus(); assertNotFound(r.getCommit()); } diff --git a/javatests/com/google/gerrit/acceptance/rest/project/ProjectLevelConfigIT.java b/javatests/com/google/gerrit/acceptance/rest/project/ProjectLevelConfigIT.java index 3e5126091e..9088afa3d9 100644 --- a/javatests/com/google/gerrit/acceptance/rest/project/ProjectLevelConfigIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/project/ProjectLevelConfigIT.java @@ -47,12 +47,7 @@ public class ProjectLevelConfigIT extends AbstractDaemonTest { cfg.setString("s2", "ss", "k2", "v2"); PushOneCommit push = pushFactory.create( - db, - admin.getIdent(), - testRepo, - "Create Project Level Config", - configName, - cfg.toText()); + admin.getIdent(), testRepo, "Create Project Level Config", configName, cfg.toText()); push.to(RefNames.REFS_CONFIG); ProjectState state = projectCache.get(project); @@ -77,7 +72,6 @@ public class ProjectLevelConfigIT extends AbstractDaemonTest { pushFactory .create( - db, admin.getIdent(), testRepo, "Create Project Level Config", @@ -97,7 +91,6 @@ public class ProjectLevelConfigIT extends AbstractDaemonTest { pushFactory .create( - db, admin.getIdent(), childTestRepo, "Create Project Level Config", @@ -132,7 +125,6 @@ public class ProjectLevelConfigIT extends AbstractDaemonTest { pushFactory .create( - db, admin.getIdent(), testRepo, "Create Project Level Config", @@ -158,7 +150,6 @@ public class ProjectLevelConfigIT extends AbstractDaemonTest { pushFactory .create( - db, admin.getIdent(), childTestRepo, "Create Project Level Config", diff --git a/javatests/com/google/gerrit/acceptance/rest/project/TagsIT.java b/javatests/com/google/gerrit/acceptance/rest/project/TagsIT.java index d4edc0de95..58acbfb0c6 100644 --- a/javatests/com/google/gerrit/acceptance/rest/project/TagsIT.java +++ b/javatests/com/google/gerrit/acceptance/rest/project/TagsIT.java @@ -126,7 +126,7 @@ public class TagsIT extends AbstractDaemonTest { public void listTagsOfNonVisibleBranch() throws Exception { grantTagPermissions(); - PushOneCommit push1 = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push1 = pushFactory.create(admin.getIdent(), testRepo); PushOneCommit.Result r1 = push1.to("refs/heads/master"); r1.assertOkStatus(); TagInput tag1 = new TagInput(); @@ -137,7 +137,7 @@ public class TagsIT extends AbstractDaemonTest { assertThat(result.revision).isEqualTo(tag1.revision); pushTo("refs/heads/hidden"); - PushOneCommit push2 = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push2 = pushFactory.create(admin.getIdent(), testRepo); PushOneCommit.Result r2 = push2.to("refs/heads/hidden"); r2.assertOkStatus(); @@ -166,7 +166,7 @@ public class TagsIT extends AbstractDaemonTest { public void lightweightTag() throws Exception { grantTagPermissions(); - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); PushOneCommit.Result r = push.to("refs/heads/master"); r.assertOkStatus(); @@ -198,7 +198,7 @@ public class TagsIT extends AbstractDaemonTest { public void annotatedTag() throws Exception { grantTagPermissions(); - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); PushOneCommit.Result r = push.to("refs/heads/master"); r.assertOkStatus(); diff --git a/javatests/com/google/gerrit/acceptance/server/change/CommentsIT.java b/javatests/com/google/gerrit/acceptance/server/change/CommentsIT.java index 5d973476c5..080be61f8e 100644 --- a/javatests/com/google/gerrit/acceptance/server/change/CommentsIT.java +++ b/javatests/com/google/gerrit/acceptance/server/change/CommentsIT.java @@ -145,7 +145,7 @@ public class CommentsIT extends AbstractDaemonTest { String file = "file"; String contents = "contents " + line; PushOneCommit push = - pushFactory.create(db, admin.getIdent(), testRepo, "first subject", file, contents); + pushFactory.create(admin.getIdent(), testRepo, "first subject", file, contents); PushOneCommit.Result r = push.to("refs/for/master"); String changeId = r.getChangeId(); String revId = r.getCommit().getName(); @@ -169,7 +169,7 @@ public class CommentsIT extends AbstractDaemonTest { String file = "file"; String contents = "contents " + line; PushOneCommit push = - pushFactory.create(db, admin.getIdent(), testRepo, "first subject", file, contents); + pushFactory.create(admin.getIdent(), testRepo, "first subject", file, contents); PushOneCommit.Result r = push.to("refs/for/master"); String changeId = r.getChangeId(); String revId = r.getCommit().getName(); @@ -201,7 +201,7 @@ public class CommentsIT extends AbstractDaemonTest { String file = "file"; String contents = "contents " + line; PushOneCommit push = - pushFactory.create(db, admin.getIdent(), testRepo, "first subject", file, contents); + pushFactory.create(admin.getIdent(), testRepo, "first subject", file, contents); PushOneCommit.Result r = push.to("refs/for/master"); String changeId = r.getChangeId(); String revId = r.getCommit().getName(); @@ -275,7 +275,7 @@ public class CommentsIT extends AbstractDaemonTest { public void listComments() throws Exception { String file = "file"; PushOneCommit push = - pushFactory.create(db, admin.getIdent(), testRepo, "first subject", file, "contents"); + pushFactory.create(admin.getIdent(), testRepo, "first subject", file, "contents"); PushOneCommit.Result r = push.to("refs/for/master"); String changeId = r.getChangeId(); String revId = r.getCommit().getName(); @@ -384,7 +384,7 @@ public class CommentsIT extends AbstractDaemonTest { String file = "file"; String contents = "contents " + line; PushOneCommit push = - pushFactory.create(db, admin.getIdent(), testRepo, "first subject", file, contents); + pushFactory.create(admin.getIdent(), testRepo, "first subject", file, contents); PushOneCommit.Result r = push.to("refs/for/master"); String changeId = r.getChangeId(); String revId = r.getCommit().getName(); @@ -427,7 +427,7 @@ public class CommentsIT extends AbstractDaemonTest { PushOneCommit.Result r2 = pushFactory - .create(db, admin.getIdent(), testRepo, SUBJECT, FILE_NAME, "content") + .create(admin.getIdent(), testRepo, SUBJECT, FILE_NAME, "content") .to("refs/for/master"); changeId = r2.getChangeId(); revId = r2.getCommit().getName(); @@ -442,8 +442,7 @@ public class CommentsIT extends AbstractDaemonTest { PushOneCommit.Result r2 = pushFactory - .create( - db, admin.getIdent(), testRepo, SUBJECT, FILE_NAME, "new content", r1.getChangeId()) + .create(admin.getIdent(), testRepo, SUBJECT, FILE_NAME, "new content", r1.getChangeId()) .to("refs/for/master"); setApiUser(admin); @@ -489,8 +488,7 @@ public class CommentsIT extends AbstractDaemonTest { PushOneCommit.Result r2 = pushFactory - .create( - db, admin.getIdent(), testRepo, SUBJECT, FILE_NAME, "new cntent", r1.getChangeId()) + .create(admin.getIdent(), testRepo, SUBJECT, FILE_NAME, "new cntent", r1.getChangeId()) .to("refs/for/master"); addComment(r1, "nit: trailing whitespace"); @@ -536,13 +534,7 @@ public class CommentsIT extends AbstractDaemonTest { PushOneCommit.Result r2 = pushFactory .create( - db, - admin.getIdent(), - testRepo, - SUBJECT, - FILE_NAME, - "new\ncntent\n", - r1.getChangeId()) + admin.getIdent(), testRepo, SUBJECT, FILE_NAME, "new\ncntent\n", r1.getChangeId()) .to("refs/for/master"); addDraft( diff --git a/javatests/com/google/gerrit/acceptance/server/change/GetRelatedIT.java b/javatests/com/google/gerrit/acceptance/server/change/GetRelatedIT.java index 803580c057..26c04294fe 100644 --- a/javatests/com/google/gerrit/acceptance/server/change/GetRelatedIT.java +++ b/javatests/com/google/gerrit/acceptance/server/change/GetRelatedIT.java @@ -84,7 +84,7 @@ public class GetRelatedIT extends AbstractDaemonTest { @Test public void getRelatedNoResult() throws Exception { - PushOneCommit push = pushFactory.create(db, admin.getIdent(), testRepo); + PushOneCommit push = pushFactory.create(admin.getIdent(), testRepo); assertRelated(push.to("refs/for/master").getPatchSetId()); } diff --git a/javatests/com/google/gerrit/acceptance/server/mail/AbstractMailIT.java b/javatests/com/google/gerrit/acceptance/server/mail/AbstractMailIT.java index c1b5cf448c..218fd30ee9 100644 --- a/javatests/com/google/gerrit/acceptance/server/mail/AbstractMailIT.java +++ b/javatests/com/google/gerrit/acceptance/server/mail/AbstractMailIT.java @@ -49,7 +49,7 @@ public class AbstractMailIT extends AbstractDaemonTest { String file = "gerrit-server/test.txt"; String contents = "contents \nlorem \nipsum \nlorem"; PushOneCommit push = - pushFactory.create(db, admin.getIdent(), testRepo, "first subject", file, contents); + pushFactory.create(admin.getIdent(), testRepo, "first subject", file, contents); PushOneCommit.Result r = push.to("refs/for/master"); String changeId = r.getChangeId(); diff --git a/javatests/com/google/gerrit/acceptance/server/mail/ChangeNotificationsIT.java b/javatests/com/google/gerrit/acceptance/server/mail/ChangeNotificationsIT.java index 35d9e88da2..58a1771c05 100644 --- a/javatests/com/google/gerrit/acceptance/server/mail/ChangeNotificationsIT.java +++ b/javatests/com/google/gerrit/acceptance/server/mail/ChangeNotificationsIT.java @@ -1754,7 +1754,7 @@ public class ChangeNotificationsIT extends AbstractNotificationTest { private void pushTo(StagedChange sc, String ref, TestAccount by, EmailStrategy emailStrategy) throws Exception { setEmailStrategy(by, emailStrategy); - pushFactory.create(db, by.getIdent(), sc.repo, sc.changeId).to(ref).assertOkStatus(); + pushFactory.create(by.getIdent(), sc.repo, sc.changeId).to(ref).assertOkStatus(); } @Test diff --git a/javatests/com/google/gerrit/acceptance/server/project/ProjectWatchIT.java b/javatests/com/google/gerrit/acceptance/server/project/ProjectWatchIT.java index f9493fa823..7f0a493a13 100644 --- a/javatests/com/google/gerrit/acceptance/server/project/ProjectWatchIT.java +++ b/javatests/com/google/gerrit/acceptance/server/project/ProjectWatchIT.java @@ -61,20 +61,19 @@ public class ProjectWatchIT extends AbstractDaemonTest { PushOneCommit.Result r = pushFactory - .create(db, admin.getIdent(), testRepo, "original subject", "a", "a1") + .create(admin.getIdent(), testRepo, "original subject", "a", "a1") .to("refs/for/master"); r.assertOkStatus(); r = pushFactory - .create( - db, admin.getIdent(), testRepo, "super sekret subject", "a", "a2", r.getChangeId()) + .create(admin.getIdent(), testRepo, "super sekret subject", "a", "a2", r.getChangeId()) .to("refs/for/master"); r.assertOkStatus(); r = pushFactory - .create(db, admin.getIdent(), testRepo, "back to original subject", "a", "a3") + .create(admin.getIdent(), testRepo, "back to original subject", "a", "a3") .to("refs/for/master"); r.assertOkStatus(); @@ -103,7 +102,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { sender.clear(); PushOneCommit.Result r = pushFactory - .create(db, admin.getIdent(), testRepo, "private change", "a", "a1") + .create(admin.getIdent(), testRepo, "private change", "a", "a1") .to("refs/for/master%private"); r.assertOkStatus(); @@ -133,16 +132,14 @@ public class ProjectWatchIT extends AbstractDaemonTest { } PushOneCommit.Result r = - pushFactory - .create(db, admin.getIdent(), testRepo, "subject", "a", "a1") - .to("refs/for/master"); + pushFactory.create(admin.getIdent(), testRepo, "subject", "a", "a1").to("refs/for/master"); r.assertOkStatus(); sender.clear(); r = pushFactory - .create(db, admin.getIdent(), testRepo, "subject", "a", "a2", r.getChangeId()) + .create(admin.getIdent(), testRepo, "subject", "a", "a2", r.getChangeId()) .to("refs/for/master%private"); r.assertOkStatus(); @@ -166,7 +163,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { sender.clear(); PushOneCommit.Result r = pushFactory - .create(db, admin.getIdent(), testRepo, "wip change", "a", "a1") + .create(admin.getIdent(), testRepo, "wip change", "a", "a1") .to("refs/for/master%wip"); r.assertOkStatus(); @@ -195,16 +192,14 @@ public class ProjectWatchIT extends AbstractDaemonTest { } PushOneCommit.Result r = - pushFactory - .create(db, admin.getIdent(), testRepo, "subject", "a", "a1") - .to("refs/for/master"); + pushFactory.create(admin.getIdent(), testRepo, "subject", "a", "a1").to("refs/for/master"); r.assertOkStatus(); sender.clear(); r = pushFactory - .create(db, admin.getIdent(), testRepo, "subject", "a", "a2", r.getChangeId()) + .create(admin.getIdent(), testRepo, "subject", "a", "a2", r.getChangeId()) .to("refs/for/master%wip"); r.assertOkStatus(); @@ -224,7 +219,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { cloneProject(new Project.NameKey(watchedProject), admin); PushOneCommit.Result r = pushFactory - .create(db, admin.getIdent(), watchedRepo, "TRIGGER", "a", "a1") + .create(admin.getIdent(), watchedRepo, "TRIGGER", "a", "a1") .to("refs/for/master"); r.assertOkStatus(); @@ -235,7 +230,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { cloneProject(new Project.NameKey(notWatchedProject), admin); r = pushFactory - .create(db, admin.getIdent(), notWatchedRepo, "DONT_TRIGGER", "a", "a1") + .create(admin.getIdent(), notWatchedRepo, "DONT_TRIGGER", "a", "a1") .to("refs/for/master"); r.assertOkStatus(); @@ -267,7 +262,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { cloneProject(new Project.NameKey(watchedProject), admin); PushOneCommit.Result r = pushFactory - .create(db, admin.getIdent(), watchedRepo, "TRIGGER", "a.txt", "a1") + .create(admin.getIdent(), watchedRepo, "TRIGGER", "a.txt", "a1") .to("refs/for/master"); r.assertOkStatus(); @@ -289,7 +284,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { // notification for user, only for user2 r = pushFactory - .create(db, admin.getIdent(), watchedRepo, "TRIGGER_USER2", "b.txt", "b1") + .create(admin.getIdent(), watchedRepo, "TRIGGER_USER2", "b.txt", "b1") .to("refs/for/master"); r.assertOkStatus(); @@ -316,7 +311,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { cloneProject(new Project.NameKey(watchedProject), admin); PushOneCommit.Result r = pushFactory - .create(db, admin.getIdent(), watchedRepo, "Document multimaster setup", "a.txt", "a1") + .create(admin.getIdent(), watchedRepo, "Document multimaster setup", "a.txt", "a1") .to("refs/for/master"); r.assertOkStatus(); @@ -332,8 +327,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { // push a change without keyword -> should not trigger email notification r = pushFactory - .create( - db, admin.getIdent(), watchedRepo, "Cleanup cache implementation", "b.txt", "b1") + .create(admin.getIdent(), watchedRepo, "Cleanup cache implementation", "b.txt", "b1") .to("refs/for/master"); r.assertOkStatus(); @@ -354,9 +348,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { TestRepository anyRepo = cloneProject(new Project.NameKey(anyProject), admin); PushOneCommit.Result r = - pushFactory - .create(db, admin.getIdent(), anyRepo, "TRIGGER", "a", "a1") - .to("refs/for/master"); + pushFactory.create(admin.getIdent(), anyRepo, "TRIGGER", "a", "a1").to("refs/for/master"); r.assertOkStatus(); // assert email notification @@ -384,7 +376,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { cloneProject(new Project.NameKey(anyProject), admin); PushOneCommit.Result r = pushFactory - .create(db, admin.getIdent(), anyRepo, "TRIGGER", "a.txt", "a1") + .create(admin.getIdent(), anyRepo, "TRIGGER", "a.txt", "a1") .to("refs/for/master"); r.assertOkStatus(); @@ -406,7 +398,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { // email notification for user, only for user2 r = pushFactory - .create(db, admin.getIdent(), anyRepo, "TRIGGER_USER2", "b.txt", "b1") + .create(admin.getIdent(), anyRepo, "TRIGGER_USER2", "b.txt", "b1") .to("refs/for/master"); r.assertOkStatus(); @@ -434,7 +426,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { cloneProject(new Project.NameKey(anyProject), admin); PushOneCommit.Result r = pushFactory - .create(db, admin.getIdent(), anyRepo, "Document multimaster setup", "a.txt", "a1") + .create(admin.getIdent(), anyRepo, "Document multimaster setup", "a.txt", "a1") .to("refs/for/master"); r.assertOkStatus(); @@ -451,7 +443,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { // notification r = pushFactory - .create(db, admin.getIdent(), anyRepo, "Cleanup cache implementation", "b.txt", "b1") + .create(admin.getIdent(), anyRepo, "Cleanup cache implementation", "b.txt", "b1") .to("refs/for/master"); r.assertOkStatus(); @@ -472,7 +464,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { cloneProject(new Project.NameKey(watchedProject), admin); PushOneCommit.Result r = pushFactory - .create(db, admin.getIdent(), watchedRepo, "ignored change", "a", "a1") + .create(admin.getIdent(), watchedRepo, "ignored change", "a", "a1") .to("refs/for/master"); r.assertOkStatus(); @@ -505,7 +497,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { cloneProject(new Project.NameKey(watchedProject), admin); PushOneCommit.Result r = pushFactory - .create(db, admin.getIdent(), watchedRepo, "private change", "a", "a1") + .create(admin.getIdent(), watchedRepo, "private change", "a", "a1") .to("refs/for/master%private"); r.assertOkStatus(); @@ -545,7 +537,7 @@ public class ProjectWatchIT extends AbstractDaemonTest { cloneProject(new Project.NameKey(watchedProject), admin); PushOneCommit.Result r = pushFactory - .create(db, admin.getIdent(), watchedRepo, "TRIGGER", "a", "a1") + .create(admin.getIdent(), watchedRepo, "TRIGGER", "a", "a1") .to("refs/for/master%private"); r.assertOkStatus(); diff --git a/javatests/com/google/gerrit/acceptance/server/rules/IgnoreSelfApprovalRuleIT.java b/javatests/com/google/gerrit/acceptance/server/rules/IgnoreSelfApprovalRuleIT.java index d1b05e319b..df8c5af402 100644 --- a/javatests/com/google/gerrit/acceptance/server/rules/IgnoreSelfApprovalRuleIT.java +++ b/javatests/com/google/gerrit/acceptance/server/rules/IgnoreSelfApprovalRuleIT.java @@ -63,7 +63,7 @@ public class IgnoreSelfApprovalRuleIT extends AbstractDaemonTest { // Create change as user TestRepository userTestRepo = cloneProject(project, user); - PushOneCommit push = pushFactory.create(db, user.getIdent(), userTestRepo); + PushOneCommit push = pushFactory.create(user.getIdent(), userTestRepo); PushOneCommit.Result r = push.to("refs/for/master"); // Approve as admin diff --git a/javatests/com/google/gerrit/acceptance/server/rules/RulesIT.java b/javatests/com/google/gerrit/acceptance/server/rules/RulesIT.java index 98dca3ef31..53ac70b38c 100644 --- a/javatests/com/google/gerrit/acceptance/server/rules/RulesIT.java +++ b/javatests/com/google/gerrit/acceptance/server/rules/RulesIT.java @@ -87,7 +87,7 @@ public class RulesIT extends AbstractDaemonTest { private SubmitRecord.Status statusForRule() throws Exception { String oldHead = getRemoteHead().name(); PushOneCommit.Result result1 = - pushFactory.create(db, user.getIdent(), testRepo).to("refs/for/master"); + pushFactory.create(user.getIdent(), testRepo).to("refs/for/master"); testRepo.reset(oldHead); ChangeData cd = result1.getChange(); diff --git a/plugins/webhooks b/plugins/webhooks index 37b062e08c..d584a96310 160000 --- a/plugins/webhooks +++ b/plugins/webhooks @@ -1 +1 @@ -Subproject commit 37b062e08c5a83c4a939777cfddc9b6f97c44cdf +Subproject commit d584a963102850c5291d91d1430f4d96bd7f84aa