The only difference is latter instantiates Nodeids, while former compares binary content as is.
Hence, with 20-30 ms per regular getLocalRevision, it pays off to use RevisionMap with at least 15-20
queries
*/
private void testRevisionMap() throws Exception {
HgChangelog changelog = hgRepo.getChangelog();
HgRevisionMap<HgChangelog> rmap = new HgRevisionMap<HgChangelog>(changelog).init(); // warm-up, ensure complete file read
int tip = changelog.getLastRevision();
// take 5 arbitrary revisions at 0, 1/4, 2/4, 3/4 and 4/4
final Nodeid[] revs = new Nodeid[5];
revs[4] = changelog.getRevision(0);
revs[3] = changelog.getRevision(tip / 4);
revs[2] = changelog.getRevision(tip / 2);
revs[1] = changelog.getRevision(tip / 4 + tip / 2);
revs[0] = changelog.getRevision(tip);
long start = System.currentTimeMillis();
for (int i = 0; i < revs.length; i++) {
final int localRev = changelog.getRevisionIndex(revs[i]);
System.out.printf("%d:%s\n", localRev, revs[i]);
}
System.out.println(System.currentTimeMillis() - start);
System.out.println();
//