git = gitManager.openRepository(project);
} catch (RepositoryNotFoundException e) {
return;
}
try {
CreateCodeReviewNotes notes = codeReviewNotesFactory.create(db, git);
try {
notes.loadBase();
for (Change change : changes) {
monitor.update(1);
PatchSet ps = db.patchSets().get(change.currentPatchSetId());
if (ps == null) {
continue;
}
notes.add(change, ObjectId.fromString(ps.getRevision().get()));
}
notes.commit("Exported prior reviews from Gerrit Code Review\n");
notes.updateRef();
} finally {
notes.release();
}
} finally {
git.close();
}
}