Read change ID sequence from notedb
Change-Id: Ib500a93d6368c7ef134422102afd8b561addd52f
This commit is contained in:
@@ -30,6 +30,7 @@ import com.google.gerrit.reviewdb.client.Project;
|
|||||||
import com.google.gerrit.reviewdb.client.RefNames;
|
import com.google.gerrit.reviewdb.client.RefNames;
|
||||||
import com.google.gerrit.reviewdb.server.ReviewDb;
|
import com.google.gerrit.reviewdb.server.ReviewDb;
|
||||||
import com.google.gerrit.server.IdentifiedUser;
|
import com.google.gerrit.server.IdentifiedUser;
|
||||||
|
import com.google.gerrit.server.Sequences;
|
||||||
import com.google.gerrit.server.account.GroupBackend;
|
import com.google.gerrit.server.account.GroupBackend;
|
||||||
import com.google.gerrit.server.change.ChangeInserter;
|
import com.google.gerrit.server.change.ChangeInserter;
|
||||||
import com.google.gerrit.server.change.ChangeResource;
|
import com.google.gerrit.server.change.ChangeResource;
|
||||||
@@ -69,6 +70,7 @@ public class ReviewProjectAccess extends ProjectAccessHandler<Change.Id> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private final ReviewDb db;
|
private final ReviewDb db;
|
||||||
|
private final Sequences seq;
|
||||||
private final IdentifiedUser user;
|
private final IdentifiedUser user;
|
||||||
private final Provider<PostReviewers> reviewersProvider;
|
private final Provider<PostReviewers> reviewersProvider;
|
||||||
private final ProjectCache projectCache;
|
private final ProjectCache projectCache;
|
||||||
@@ -88,6 +90,7 @@ public class ReviewProjectAccess extends ProjectAccessHandler<Change.Id> {
|
|||||||
ChangeInserter.Factory changeInserterFactory,
|
ChangeInserter.Factory changeInserterFactory,
|
||||||
BatchUpdate.Factory updateFactory,
|
BatchUpdate.Factory updateFactory,
|
||||||
Provider<SetParent> setParent,
|
Provider<SetParent> setParent,
|
||||||
|
Sequences seq,
|
||||||
|
|
||||||
@Assisted("projectName") Project.NameKey projectName,
|
@Assisted("projectName") Project.NameKey projectName,
|
||||||
@Nullable @Assisted ObjectId base,
|
@Nullable @Assisted ObjectId base,
|
||||||
@@ -98,6 +101,7 @@ public class ReviewProjectAccess extends ProjectAccessHandler<Change.Id> {
|
|||||||
allProjects, setParent, projectName, base, sectionList,
|
allProjects, setParent, projectName, base, sectionList,
|
||||||
parentProjectName, message, false);
|
parentProjectName, message, false);
|
||||||
this.db = db;
|
this.db = db;
|
||||||
|
this.seq = seq;
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.reviewersProvider = reviewersProvider;
|
this.reviewersProvider = reviewersProvider;
|
||||||
this.projectCache = projectCache;
|
this.projectCache = projectCache;
|
||||||
@@ -111,7 +115,7 @@ public class ReviewProjectAccess extends ProjectAccessHandler<Change.Id> {
|
|||||||
ProjectConfig config, MetaDataUpdate md, boolean parentProjectUpdate)
|
ProjectConfig config, MetaDataUpdate md, boolean parentProjectUpdate)
|
||||||
throws IOException, OrmException {
|
throws IOException, OrmException {
|
||||||
md.setInsertChangeId(true);
|
md.setInsertChangeId(true);
|
||||||
Change.Id changeId = new Change.Id(db.nextChangeId());
|
Change.Id changeId = new Change.Id(seq.nextChangeId());
|
||||||
RevCommit commit =
|
RevCommit commit =
|
||||||
config.commitToNewRef(md, new PatchSet.Id(changeId,
|
config.commitToNewRef(md, new PatchSet.Id(changeId,
|
||||||
Change.INITIAL_PATCH_SET_ID).toRefName());
|
Change.INITIAL_PATCH_SET_ID).toRefName());
|
||||||
|
|||||||
@@ -113,8 +113,15 @@ public interface ReviewDb extends Schema {
|
|||||||
@Sequence
|
@Sequence
|
||||||
int nextAccountGroupId() throws OrmException;
|
int nextAccountGroupId() throws OrmException;
|
||||||
|
|
||||||
/** Next unique id for a {@link Change}. */
|
int FIRST_CHANGE_ID = 1;
|
||||||
@Sequence
|
|
||||||
|
/**
|
||||||
|
* Next unique id for a {@link Change}.
|
||||||
|
*
|
||||||
|
* @deprecated use {@link com.google.gerrit.server.Sequences#nextChangeId()}.
|
||||||
|
*/
|
||||||
|
@Sequence(startWith = FIRST_CHANGE_ID)
|
||||||
|
@Deprecated
|
||||||
int nextChangeId() throws OrmException;
|
int nextChangeId() throws OrmException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ public class ChangeUtil {
|
|||||||
|
|
||||||
private final Provider<CurrentUser> user;
|
private final Provider<CurrentUser> user;
|
||||||
private final Provider<ReviewDb> db;
|
private final Provider<ReviewDb> db;
|
||||||
|
private final Sequences seq;
|
||||||
private final Provider<InternalChangeQuery> queryProvider;
|
private final Provider<InternalChangeQuery> queryProvider;
|
||||||
private final ChangeControl.GenericFactory changeControlFactory;
|
private final ChangeControl.GenericFactory changeControlFactory;
|
||||||
private final RevertedSender.Factory revertedSenderFactory;
|
private final RevertedSender.Factory revertedSenderFactory;
|
||||||
@@ -186,6 +187,7 @@ public class ChangeUtil {
|
|||||||
@Inject
|
@Inject
|
||||||
ChangeUtil(Provider<CurrentUser> user,
|
ChangeUtil(Provider<CurrentUser> user,
|
||||||
Provider<ReviewDb> db,
|
Provider<ReviewDb> db,
|
||||||
|
Sequences seq,
|
||||||
Provider<InternalChangeQuery> queryProvider,
|
Provider<InternalChangeQuery> queryProvider,
|
||||||
ChangeControl.GenericFactory changeControlFactory,
|
ChangeControl.GenericFactory changeControlFactory,
|
||||||
RevertedSender.Factory revertedSenderFactory,
|
RevertedSender.Factory revertedSenderFactory,
|
||||||
@@ -196,6 +198,7 @@ public class ChangeUtil {
|
|||||||
ChangeUpdate.Factory changeUpdateFactory) {
|
ChangeUpdate.Factory changeUpdateFactory) {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.db = db;
|
this.db = db;
|
||||||
|
this.seq = seq;
|
||||||
this.queryProvider = queryProvider;
|
this.queryProvider = queryProvider;
|
||||||
this.changeControlFactory = changeControlFactory;
|
this.changeControlFactory = changeControlFactory;
|
||||||
this.revertedSenderFactory = revertedSenderFactory;
|
this.revertedSenderFactory = revertedSenderFactory;
|
||||||
@@ -262,7 +265,7 @@ public class ChangeUtil {
|
|||||||
RefControl refControl = ctl.getRefControl();
|
RefControl refControl = ctl.getRefControl();
|
||||||
Change change = new Change(
|
Change change = new Change(
|
||||||
new Change.Key("I" + computedChangeId.name()),
|
new Change.Key("I" + computedChangeId.name()),
|
||||||
new Change.Id(db.get().nextChangeId()),
|
new Change.Id(seq.nextChangeId()),
|
||||||
user.get().getAccountId(),
|
user.get().getAccountId(),
|
||||||
changeToRevert.getDest(),
|
changeToRevert.getDest(),
|
||||||
TimeUtil.nowTs());
|
TimeUtil.nowTs());
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
// Copyright (C) 2016 The Android Open Source Project
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
package com.google.gerrit.server;
|
||||||
|
|
||||||
|
import com.google.gerrit.reviewdb.server.ReviewDb;
|
||||||
|
import com.google.gerrit.server.config.AllProjectsName;
|
||||||
|
import com.google.gerrit.server.git.GitRepositoryManager;
|
||||||
|
import com.google.gerrit.server.notedb.NotesMigration;
|
||||||
|
import com.google.gerrit.server.notedb.RepoSequence;
|
||||||
|
import com.google.gwtorm.server.OrmException;
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.Provider;
|
||||||
|
import com.google.inject.Singleton;
|
||||||
|
|
||||||
|
@Singleton
|
||||||
|
public class Sequences {
|
||||||
|
private final Provider<ReviewDb> db;
|
||||||
|
private final NotesMigration migration;
|
||||||
|
private final RepoSequence changeSeq;
|
||||||
|
|
||||||
|
@Inject
|
||||||
|
Sequences(Provider<ReviewDb> db,
|
||||||
|
NotesMigration migration,
|
||||||
|
GitRepositoryManager repoManager,
|
||||||
|
AllProjectsName allProjects) {
|
||||||
|
this.db = db;
|
||||||
|
this.migration = migration;
|
||||||
|
if (migration.readChanges()) {
|
||||||
|
changeSeq = new RepoSequence(
|
||||||
|
repoManager, allProjects, "changes", ReviewDb.FIRST_CHANGE_ID, 100);
|
||||||
|
} else {
|
||||||
|
changeSeq = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
public int nextChangeId() throws OrmException {
|
||||||
|
if (migration.readChanges()) {
|
||||||
|
return changeSeq.next();
|
||||||
|
} else {
|
||||||
|
return db.get().nextChangeId();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -30,6 +30,7 @@ import com.google.gerrit.server.ChangeMessagesUtil;
|
|||||||
import com.google.gerrit.server.ChangeUtil;
|
import com.google.gerrit.server.ChangeUtil;
|
||||||
import com.google.gerrit.server.GerritPersonIdent;
|
import com.google.gerrit.server.GerritPersonIdent;
|
||||||
import com.google.gerrit.server.IdentifiedUser;
|
import com.google.gerrit.server.IdentifiedUser;
|
||||||
|
import com.google.gerrit.server.Sequences;
|
||||||
import com.google.gerrit.server.git.BatchUpdate;
|
import com.google.gerrit.server.git.BatchUpdate;
|
||||||
import com.google.gerrit.server.git.CodeReviewCommit;
|
import com.google.gerrit.server.git.CodeReviewCommit;
|
||||||
import com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk;
|
import com.google.gerrit.server.git.CodeReviewCommit.CodeReviewRevWalk;
|
||||||
@@ -71,6 +72,7 @@ import java.util.TimeZone;
|
|||||||
public class CherryPickChange {
|
public class CherryPickChange {
|
||||||
|
|
||||||
private final Provider<ReviewDb> db;
|
private final Provider<ReviewDb> db;
|
||||||
|
private final Sequences seq;
|
||||||
private final Provider<InternalChangeQuery> queryProvider;
|
private final Provider<InternalChangeQuery> queryProvider;
|
||||||
private final GitRepositoryManager gitManager;
|
private final GitRepositoryManager gitManager;
|
||||||
private final TimeZone serverTimeZone;
|
private final TimeZone serverTimeZone;
|
||||||
@@ -84,6 +86,7 @@ public class CherryPickChange {
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
CherryPickChange(Provider<ReviewDb> db,
|
CherryPickChange(Provider<ReviewDb> db,
|
||||||
|
Sequences seq,
|
||||||
Provider<InternalChangeQuery> queryProvider,
|
Provider<InternalChangeQuery> queryProvider,
|
||||||
@GerritPersonIdent PersonIdent myIdent,
|
@GerritPersonIdent PersonIdent myIdent,
|
||||||
GitRepositoryManager gitManager,
|
GitRepositoryManager gitManager,
|
||||||
@@ -95,6 +98,7 @@ public class CherryPickChange {
|
|||||||
ChangeUpdate.Factory updateFactory,
|
ChangeUpdate.Factory updateFactory,
|
||||||
BatchUpdate.Factory batchUpdateFactory) {
|
BatchUpdate.Factory batchUpdateFactory) {
|
||||||
this.db = db;
|
this.db = db;
|
||||||
|
this.seq = seq;
|
||||||
this.queryProvider = queryProvider;
|
this.queryProvider = queryProvider;
|
||||||
this.gitManager = gitManager;
|
this.gitManager = gitManager;
|
||||||
this.serverTimeZone = myIdent.getTimeZone();
|
this.serverTimeZone = myIdent.getTimeZone();
|
||||||
@@ -233,7 +237,7 @@ public class CherryPickChange {
|
|||||||
IdentifiedUser identifiedUser, String topic, Branch.NameKey sourceBranch)
|
IdentifiedUser identifiedUser, String topic, Branch.NameKey sourceBranch)
|
||||||
throws RestApiException, UpdateException, OrmException {
|
throws RestApiException, UpdateException, OrmException {
|
||||||
Change change =
|
Change change =
|
||||||
new Change(changeKey, new Change.Id(db.get().nextChangeId()),
|
new Change(changeKey, new Change.Id(seq.nextChangeId()),
|
||||||
identifiedUser.getAccountId(), new Branch.NameKey(project,
|
identifiedUser.getAccountId(), new Branch.NameKey(project,
|
||||||
destRef.getName()), TimeUtil.nowTs());
|
destRef.getName()), TimeUtil.nowTs());
|
||||||
change.setTopic(topic);
|
change.setTopic(topic);
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import com.google.gerrit.server.ChangeUtil;
|
|||||||
import com.google.gerrit.server.CurrentUser;
|
import com.google.gerrit.server.CurrentUser;
|
||||||
import com.google.gerrit.server.GerritPersonIdent;
|
import com.google.gerrit.server.GerritPersonIdent;
|
||||||
import com.google.gerrit.server.IdentifiedUser;
|
import com.google.gerrit.server.IdentifiedUser;
|
||||||
|
import com.google.gerrit.server.Sequences;
|
||||||
import com.google.gerrit.server.config.GerritServerConfig;
|
import com.google.gerrit.server.config.GerritServerConfig;
|
||||||
import com.google.gerrit.server.git.BatchUpdate;
|
import com.google.gerrit.server.git.BatchUpdate;
|
||||||
import com.google.gerrit.server.git.GitRepositoryManager;
|
import com.google.gerrit.server.git.GitRepositoryManager;
|
||||||
@@ -77,6 +78,7 @@ public class CreateChange implements
|
|||||||
|
|
||||||
private final Provider<ReviewDb> db;
|
private final Provider<ReviewDb> db;
|
||||||
private final GitRepositoryManager gitManager;
|
private final GitRepositoryManager gitManager;
|
||||||
|
private final Sequences seq;
|
||||||
private final TimeZone serverTimeZone;
|
private final TimeZone serverTimeZone;
|
||||||
private final Provider<CurrentUser> user;
|
private final Provider<CurrentUser> user;
|
||||||
private final ProjectsCollection projectsCollection;
|
private final ProjectsCollection projectsCollection;
|
||||||
@@ -89,6 +91,7 @@ public class CreateChange implements
|
|||||||
@Inject
|
@Inject
|
||||||
CreateChange(Provider<ReviewDb> db,
|
CreateChange(Provider<ReviewDb> db,
|
||||||
GitRepositoryManager gitManager,
|
GitRepositoryManager gitManager,
|
||||||
|
Sequences seq,
|
||||||
@GerritPersonIdent PersonIdent myIdent,
|
@GerritPersonIdent PersonIdent myIdent,
|
||||||
Provider<CurrentUser> user,
|
Provider<CurrentUser> user,
|
||||||
ProjectsCollection projectsCollection,
|
ProjectsCollection projectsCollection,
|
||||||
@@ -99,6 +102,7 @@ public class CreateChange implements
|
|||||||
@GerritServerConfig Config config) {
|
@GerritServerConfig Config config) {
|
||||||
this.db = db;
|
this.db = db;
|
||||||
this.gitManager = gitManager;
|
this.gitManager = gitManager;
|
||||||
|
this.seq = seq;
|
||||||
this.serverTimeZone = myIdent.getTimeZone();
|
this.serverTimeZone = myIdent.getTimeZone();
|
||||||
this.user = user;
|
this.user = user;
|
||||||
this.projectsCollection = projectsCollection;
|
this.projectsCollection = projectsCollection;
|
||||||
@@ -194,7 +198,7 @@ public class CreateChange implements
|
|||||||
|
|
||||||
Change change = new Change(
|
Change change = new Change(
|
||||||
getChangeId(id, c),
|
getChangeId(id, c),
|
||||||
new Change.Id(db.get().nextChangeId()),
|
new Change.Id(seq.nextChangeId()),
|
||||||
me.getAccountId(),
|
me.getAccountId(),
|
||||||
new Branch.NameKey(project, refName),
|
new Branch.NameKey(project, refName),
|
||||||
now);
|
now);
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ import com.google.gerrit.server.ApprovalsUtil;
|
|||||||
import com.google.gerrit.server.CmdLineParserModule;
|
import com.google.gerrit.server.CmdLineParserModule;
|
||||||
import com.google.gerrit.server.IdentifiedUser;
|
import com.google.gerrit.server.IdentifiedUser;
|
||||||
import com.google.gerrit.server.PluginUser;
|
import com.google.gerrit.server.PluginUser;
|
||||||
|
import com.google.gerrit.server.Sequences;
|
||||||
import com.google.gerrit.server.account.AccountByEmailCacheImpl;
|
import com.google.gerrit.server.account.AccountByEmailCacheImpl;
|
||||||
import com.google.gerrit.server.account.AccountCacheImpl;
|
import com.google.gerrit.server.account.AccountCacheImpl;
|
||||||
import com.google.gerrit.server.account.AccountControl;
|
import com.google.gerrit.server.account.AccountControl;
|
||||||
@@ -165,6 +166,7 @@ public class GerritGlobalModule extends FactoryModule {
|
|||||||
|
|
||||||
bind(IdGenerator.class);
|
bind(IdGenerator.class);
|
||||||
bind(RulesCache.class);
|
bind(RulesCache.class);
|
||||||
|
bind(Sequences.class);
|
||||||
install(authModule);
|
install(authModule);
|
||||||
install(AccountByEmailCacheImpl.module());
|
install(AccountByEmailCacheImpl.module());
|
||||||
install(AccountCacheImpl.module());
|
install(AccountCacheImpl.module());
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ import com.google.gerrit.server.ApprovalsUtil;
|
|||||||
import com.google.gerrit.server.ChangeMessagesUtil;
|
import com.google.gerrit.server.ChangeMessagesUtil;
|
||||||
import com.google.gerrit.server.ChangeUtil;
|
import com.google.gerrit.server.ChangeUtil;
|
||||||
import com.google.gerrit.server.IdentifiedUser;
|
import com.google.gerrit.server.IdentifiedUser;
|
||||||
|
import com.google.gerrit.server.Sequences;
|
||||||
import com.google.gerrit.server.account.AccountCache;
|
import com.google.gerrit.server.account.AccountCache;
|
||||||
import com.google.gerrit.server.account.AccountResolver;
|
import com.google.gerrit.server.account.AccountResolver;
|
||||||
import com.google.gerrit.server.change.ChangeInserter;
|
import com.google.gerrit.server.change.ChangeInserter;
|
||||||
@@ -284,6 +285,7 @@ public class ReceiveCommits {
|
|||||||
|
|
||||||
private final IdentifiedUser user;
|
private final IdentifiedUser user;
|
||||||
private final ReviewDb db;
|
private final ReviewDb db;
|
||||||
|
private final Sequences seq;
|
||||||
private final Provider<InternalChangeQuery> queryProvider;
|
private final Provider<InternalChangeQuery> queryProvider;
|
||||||
private final ChangeData.Factory changeDataFactory;
|
private final ChangeData.Factory changeDataFactory;
|
||||||
private final ChangeUpdate.Factory updateFactory;
|
private final ChangeUpdate.Factory updateFactory;
|
||||||
@@ -355,6 +357,7 @@ public class ReceiveCommits {
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
ReceiveCommits(final ReviewDb db,
|
ReceiveCommits(final ReviewDb db,
|
||||||
|
final Sequences seq,
|
||||||
final Provider<InternalChangeQuery> queryProvider,
|
final Provider<InternalChangeQuery> queryProvider,
|
||||||
final SchemaFactory<ReviewDb> schemaFactory,
|
final SchemaFactory<ReviewDb> schemaFactory,
|
||||||
final ChangeData.Factory changeDataFactory,
|
final ChangeData.Factory changeDataFactory,
|
||||||
@@ -401,6 +404,7 @@ public class ReceiveCommits {
|
|||||||
final SetHashtagsOp.Factory hashtagsFactory) throws IOException {
|
final SetHashtagsOp.Factory hashtagsFactory) throws IOException {
|
||||||
this.user = projectControl.getUser().asIdentifiedUser();
|
this.user = projectControl.getUser().asIdentifiedUser();
|
||||||
this.db = db;
|
this.db = db;
|
||||||
|
this.seq = seq;
|
||||||
this.queryProvider = queryProvider;
|
this.queryProvider = queryProvider;
|
||||||
this.changeDataFactory = changeDataFactory;
|
this.changeDataFactory = changeDataFactory;
|
||||||
this.updateFactory = updateFactory;
|
this.updateFactory = updateFactory;
|
||||||
@@ -1733,7 +1737,7 @@ public class ReceiveCommits {
|
|||||||
throws OrmException {
|
throws OrmException {
|
||||||
commit = c;
|
commit = c;
|
||||||
change = new Change(changeKey,
|
change = new Change(changeKey,
|
||||||
new Change.Id(db.nextChangeId()),
|
new Change.Id(seq.nextChangeId()),
|
||||||
user.getAccountId(),
|
user.getAccountId(),
|
||||||
magicBranch.dest,
|
magicBranch.dest,
|
||||||
TimeUtil.nowTs());
|
TimeUtil.nowTs());
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ import com.google.gerrit.reviewdb.client.Project;
|
|||||||
import com.google.gerrit.reviewdb.server.ReviewDb;
|
import com.google.gerrit.reviewdb.server.ReviewDb;
|
||||||
import com.google.gerrit.server.CurrentUser;
|
import com.google.gerrit.server.CurrentUser;
|
||||||
import com.google.gerrit.server.IdentifiedUser;
|
import com.google.gerrit.server.IdentifiedUser;
|
||||||
|
import com.google.gerrit.server.Sequences;
|
||||||
import com.google.gerrit.server.account.AccountManager;
|
import com.google.gerrit.server.account.AccountManager;
|
||||||
import com.google.gerrit.server.account.AuthRequest;
|
import com.google.gerrit.server.account.AuthRequest;
|
||||||
import com.google.gerrit.server.account.GroupCache;
|
import com.google.gerrit.server.account.GroupCache;
|
||||||
@@ -104,24 +105,25 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Inject protected AccountManager accountManager;
|
@Inject protected AccountManager accountManager;
|
||||||
|
@Inject protected AddMembers addMembers;
|
||||||
@Inject protected BatchUpdate.Factory updateFactory;
|
@Inject protected BatchUpdate.Factory updateFactory;
|
||||||
@Inject protected ChangeInserter.Factory changeFactory;
|
|
||||||
@Inject protected PatchSetInserter.Factory patchSetFactory;
|
|
||||||
@Inject protected ChangeControl.GenericFactory changeControlFactory;
|
@Inject protected ChangeControl.GenericFactory changeControlFactory;
|
||||||
|
@Inject protected ChangeInserter.Factory changeFactory;
|
||||||
|
@Inject protected ChangeQueryBuilder queryBuilder;
|
||||||
@Inject protected GerritApi gApi;
|
@Inject protected GerritApi gApi;
|
||||||
|
@Inject protected GroupCache groupCache;
|
||||||
@Inject protected IdentifiedUser.GenericFactory userFactory;
|
@Inject protected IdentifiedUser.GenericFactory userFactory;
|
||||||
@Inject protected IndexCollection indexes;
|
@Inject protected IndexCollection indexes;
|
||||||
@Inject protected InMemoryDatabase schemaFactory;
|
@Inject protected InMemoryDatabase schemaFactory;
|
||||||
@Inject protected InMemoryRepositoryManager repoManager;
|
@Inject protected InMemoryRepositoryManager repoManager;
|
||||||
@Inject protected InternalChangeQuery internalChangeQuery;
|
@Inject protected InternalChangeQuery internalChangeQuery;
|
||||||
@Inject protected NotesMigration notesMigration;
|
@Inject protected NotesMigration notesMigration;
|
||||||
|
@Inject protected PatchSetInserter.Factory patchSetFactory;
|
||||||
@Inject protected ProjectControl.GenericFactory projectControlFactory;
|
@Inject protected ProjectControl.GenericFactory projectControlFactory;
|
||||||
@Inject protected ChangeQueryBuilder queryBuilder;
|
|
||||||
@Inject protected QueryProcessor queryProcessor;
|
@Inject protected QueryProcessor queryProcessor;
|
||||||
@Inject protected SchemaCreator schemaCreator;
|
@Inject protected SchemaCreator schemaCreator;
|
||||||
|
@Inject protected Sequences seq;
|
||||||
@Inject protected ThreadLocalRequestContext requestContext;
|
@Inject protected ThreadLocalRequestContext requestContext;
|
||||||
@Inject protected GroupCache groupCache;
|
|
||||||
@Inject protected AddMembers addMembers;
|
|
||||||
|
|
||||||
protected LifecycleManager lifecycle;
|
protected LifecycleManager lifecycle;
|
||||||
protected ReviewDb db;
|
protected ReviewDb db;
|
||||||
@@ -1396,7 +1398,7 @@ public abstract class AbstractQueryChangesTest extends GerritServerTests {
|
|||||||
Project.NameKey project = new Project.NameKey(
|
Project.NameKey project = new Project.NameKey(
|
||||||
repo.getRepository().getDescription().getRepositoryName());
|
repo.getRepository().getDescription().getRepositoryName());
|
||||||
|
|
||||||
Change.Id id = new Change.Id(db.nextChangeId());
|
Change.Id id = new Change.Id(seq.nextChangeId());
|
||||||
if (key == null) {
|
if (key == null) {
|
||||||
key = "I" + Hashing.sha1().newHasher()
|
key = "I" + Hashing.sha1().newHasher()
|
||||||
.putInt(id.get())
|
.putInt(id.get())
|
||||||
|
|||||||
Reference in New Issue
Block a user