in src/main/java/com/googlesource/gerrit/plugins/renameproject/database/DatabaseRenameHandler.java [92:120]
public List<Change.Id> rename(
List<Change.Id> changes, Project.NameKey newProjectKey, Optional<ProgressMonitor> opm)
throws RenameRevertException, IOException, ConfigInvalidException {
opm.ifPresent(pm -> pm.beginTask("Updating changes in the database"));
log.debug("Updating the changes in noteDb related to project {}", oldProjectKey.get());
try {
updateWatchEntries(newProjectKey);
} catch (Exception e) {
log.error(
"Failed to update changes in noteDb for project {}, exception caught: {}. Rolling back the operation.",
oldProjectKey.get(),
e.toString());
try {
updateWatchEntries(newProjectKey);
} catch (Exception revertEx) {
log.error(
"Failed to rollback changes in noteDb from project {} to project {}, exception caught: {}",
newProjectKey.get(),
oldProjectKey.get(),
revertEx.toString());
throw new RenameRevertException(revertEx, e);
}
throw e;
}
log.debug(
"Successfully updated the changes in noteDb related to project {}", oldProjectKey.get());
return changes;
}