Merge "NoteDbUpdateManager: Remove code/change repo distinction"
This commit is contained in:
@@ -192,7 +192,7 @@ public class ChangeRebuilderImpl extends ChangeRebuilder {
|
|||||||
deleteRef(change, changeMetaRepo, manager.getChangeRepo().cmds);
|
deleteRef(change, changeMetaRepo, manager.getChangeRepo().cmds);
|
||||||
|
|
||||||
for (PatchSet ps : bundle.getPatchSets()) {
|
for (PatchSet ps : bundle.getPatchSets()) {
|
||||||
events.add(new PatchSetEvent(change, ps, manager.getCodeRepo().rw));
|
events.add(new PatchSetEvent(change, ps, manager.getChangeRepo().rw));
|
||||||
for (PatchLineComment c : getPatchLineComments(bundle, ps)) {
|
for (PatchLineComment c : getPatchLineComments(bundle, ps)) {
|
||||||
PatchLineCommentEvent e =
|
PatchLineCommentEvent e =
|
||||||
new PatchLineCommentEvent(c, change, ps, patchListCache);
|
new PatchLineCommentEvent(c, change, ps, patchListCache);
|
||||||
|
|||||||
@@ -104,7 +104,6 @@ public class NoteDbUpdateManager {
|
|||||||
private final ListMultimap<String, ChangeUpdate> changeUpdates;
|
private final ListMultimap<String, ChangeUpdate> changeUpdates;
|
||||||
private final ListMultimap<String, ChangeDraftUpdate> draftUpdates;
|
private final ListMultimap<String, ChangeDraftUpdate> draftUpdates;
|
||||||
|
|
||||||
private OpenRepo codeRepo;
|
|
||||||
private OpenRepo changeRepo;
|
private OpenRepo changeRepo;
|
||||||
private OpenRepo allUsersRepo;
|
private OpenRepo allUsersRepo;
|
||||||
private Map<Change.Id, NoteDbChangeState.Delta> staged;
|
private Map<Change.Id, NoteDbChangeState.Delta> staged;
|
||||||
@@ -131,12 +130,6 @@ public class NoteDbUpdateManager {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public NoteDbUpdateManager setCodeRepo(Repository repo, RevWalk rw) {
|
|
||||||
checkState(codeRepo == null, "code repo already initialized");
|
|
||||||
codeRepo = new OpenRepo(repo, rw, null, null, false);
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public NoteDbUpdateManager setAllUsersRepo(Repository repo, RevWalk rw,
|
public NoteDbUpdateManager setAllUsersRepo(Repository repo, RevWalk rw,
|
||||||
ObjectInserter ins, ChainedReceiveCommands cmds) {
|
ObjectInserter ins, ChainedReceiveCommands cmds) {
|
||||||
checkState(allUsersRepo == null, "All-Users repo already initialized");
|
checkState(allUsersRepo == null, "All-Users repo already initialized");
|
||||||
@@ -149,22 +142,11 @@ public class NoteDbUpdateManager {
|
|||||||
return changeRepo;
|
return changeRepo;
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenRepo getCodeRepo() throws IOException {
|
|
||||||
initCodeRepo();
|
|
||||||
return codeRepo;
|
|
||||||
}
|
|
||||||
|
|
||||||
OpenRepo getAllUsersRepo() throws IOException {
|
OpenRepo getAllUsersRepo() throws IOException {
|
||||||
initAllUsersRepo();
|
initAllUsersRepo();
|
||||||
return allUsersRepo;
|
return allUsersRepo;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initCodeRepo() throws IOException {
|
|
||||||
if (codeRepo == null) {
|
|
||||||
codeRepo = openRepo(projectName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initChangeRepo() throws IOException {
|
private void initChangeRepo() throws IOException {
|
||||||
if (changeRepo == null) {
|
if (changeRepo == null) {
|
||||||
changeRepo = openRepo(projectName);
|
changeRepo = openRepo(projectName);
|
||||||
|
|||||||
Reference in New Issue
Block a user