Return more structured result from ChangeRebuilder
Refactors ChangeRebuilder and NoteDbUpdateManager to return a new type encapsulating both the new NoteDbChangeState (which is intentionally not part of the original staged result) and the underlying staged result with its possibly-not-yet-written NoteDb data. Change-Id: I2ff014e9fe01910a2b77b1f5417f1f11dc84b610
This commit is contained in:
@@ -160,12 +160,12 @@ public class DraftCommentNotes extends AbstractChangeNotes<DraftCommentNotes> {
|
||||
|
||||
private LoadHandle rebuildAndOpen(Repository repo) throws IOException {
|
||||
try {
|
||||
NoteDbChangeState newState =
|
||||
NoteDbUpdateManager.Result r =
|
||||
args.rebuilder.get().rebuild(args.db.get(), getChangeId());
|
||||
if (newState == null) {
|
||||
if (r == null) {
|
||||
return super.openHandle(repo); // May be null in tests.
|
||||
}
|
||||
ObjectId draftsId = newState.getDraftIds().get(author);
|
||||
ObjectId draftsId = r.newState().getDraftIds().get(author);
|
||||
repo.scanForRepoChanges();
|
||||
return LoadHandle.create(ChangeNotesCommit.newRevWalk(repo), draftsId);
|
||||
} catch (NoSuchChangeException e) {
|
||||
|
Reference in New Issue
Block a user