int fileId = files.get(repo_path);
for (HistoryEntry entry : hist.getHistoryEntries()) {
retry:
for (int i = 0;; i++) {
final ConnectionResource conn =
connectionManager.getConnectionResource();
addFilemove = conn.getStatement(ADD_FILEMOVE);
addFilechange = conn.getStatement(ADD_FILECHANGE);
try {
int changesetId = getIdForRevision(entry.getRevision(),
getRepositoryId(conn, repository));
/*
* If the file exists in the changeset, store it in
* the table tracking moves of the file when it had
* one of its precedent names so it can be found
* when performing historyget on directory.
*/
if (entry.getFiles().contains(repo_path)) {
addFilechange.setInt(1, changesetId);
addFilechange.setInt(2, fileId);
addFilechange.executeUpdate();
} else {
addFilemove.setInt(1, changesetId);
addFilemove.setInt(2, fileId);
addFilemove.executeUpdate();
}
conn.commit();
break retry;
} catch (SQLException sqle) {
handleSQLException(sqle, i);
conn.rollback();
} finally {
connectionManager.releaseConnection(conn);
}
}
}