comparison src/com/tmate/hgkit/ll/Changelog.java @ 47:b01500fe2604

Log command output to match 'hg log'
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 14 Jan 2011 20:03:14 +0100
parents e929cecae4e1
children e34f90b9ded1
comparison
equal deleted inserted replaced
46:4022c34a4804 47:b01500fe2604
21 Revlog.Inspector i = new Revlog.Inspector() { 21 Revlog.Inspector i = new Revlog.Inspector() {
22 22
23 public void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[] nodeid, byte[] data) { 23 public void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[] nodeid, byte[] data) {
24 Changeset cset = Changeset.parse(data, 0, data.length); 24 Changeset cset = Changeset.parse(data, 0, data.length);
25 // XXX there's no guarantee for Changeset.Callback that distinct instance comes each time, consider instance reuse 25 // XXX there's no guarantee for Changeset.Callback that distinct instance comes each time, consider instance reuse
26 inspector.next(cset); 26 inspector.next(revisionNumber, Nodeid.fromBinary(nodeid, 0), cset);
27 } 27 }
28 }; 28 };
29 content.iterate(0, content.revisionCount() - 1, true, i); 29 content.iterate(0, content.revisionCount() - 1, true, i);
30 } 30 }
31 31
49 Revlog.Inspector i = new Revlog.Inspector() { 49 Revlog.Inspector i = new Revlog.Inspector() {
50 50
51 public void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[] nodeid, byte[] data) { 51 public void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[] nodeid, byte[] data) {
52 if (Arrays.binarySearch(revisions, revisionNumber) >= 0) { 52 if (Arrays.binarySearch(revisions, revisionNumber) >= 0) {
53 Changeset cset = Changeset.parse(data, 0, data.length); 53 Changeset cset = Changeset.parse(data, 0, data.length);
54 inspector.next(cset); 54 inspector.next(revisionNumber, Nodeid.fromBinary(nodeid, 0), cset);
55 } 55 }
56 } 56 }
57 }; 57 };
58 Arrays.sort(revisions); 58 Arrays.sort(revisions);
59 content.iterate(revisions[0], revisions[revisions.length - 1], true, i); 59 content.iterate(revisions[0], revisions[revisions.length - 1], true, i);