* @return first commit id that will be preserved
* @throws Exception
* if an error occurs
*/
protected Id markCommits() throws Exception {
StoredCommit commit = getHeadCommit();
long tsLimit = commit.getCommitTS() - (60 * 60 * 1000);
for (;;) {
markCommit(commit);
Id id = commit.getParentId();
if (id == null) {
break;
}
StoredCommit parentCommit = getCommit(id);
if (parentCommit.getCommitTS() < tsLimit) {
break;
}
commit = parentCommit;
}
return commit.getId();