Notedb: Implement patch set groups

This field is mutable, which adds the complication that we might
parse a new value for groups in a later commit, before parsing the
Commit field that allows us to populate the patch set maps. Use a
sentinel RevId to handle this case internally.

Change-Id: I4d168f078241660c8e72ff709655081d99ac2b66
This commit is contained in:
Dave Borowitz
2016-01-22 16:32:59 -05:00
parent 0a8ee423b2
commit 95437f623f
9 changed files with 169 additions and 35 deletions

View File

@@ -47,6 +47,7 @@ import com.google.gerrit.server.AnonymousUser;
import com.google.gerrit.server.GerritPersonIdent;
import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.OutputFormat;
import com.google.gerrit.server.PatchSetUtil;
import com.google.gerrit.server.account.AccountCache;
import com.google.gerrit.server.account.GroupCache;
import com.google.gerrit.server.config.AllProjectsName;
@@ -170,6 +171,9 @@ public abstract class AbstractDaemonTest {
@Inject
protected ChangeData.Factory changeDataFactory;
@Inject
protected PatchSetUtil psUtil;
protected TestRepository<InMemoryRepository> testRepo;
protected GerritServer server;
protected TestAccount admin;
@@ -634,4 +638,8 @@ public abstract class AbstractDaemonTest {
protected PatchSet getPatchSet(PatchSet.Id psId) throws OrmException {
return changeDataFactory.create(db, psId.getParentKey()).patchSet(psId);
}
protected IdentifiedUser user(TestAccount testAccount) {
return identifiedUserFactory.create(Providers.of(db), testAccount.getId());
}
}