Mercurial > jhg
comparison test/org/tmatesoft/hg/test/TestAuxUtilities.java @ 431:12f668401613
FIXMEs: awkward API refactored, what need to be internal got hidden; public aspects got captured in slim interfaces
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 29 Mar 2012 20:54:04 +0200 |
parents | 6437d261048a |
children | 072b5f3ed0c8 |
comparison
equal
deleted
inserted
replaced
430:d280759c2a3f | 431:12f668401613 |
---|---|
217 } | 217 } |
218 | 218 |
219 @Test | 219 @Test |
220 public void testRevlogInspectors() throws Exception { // TODO move to better place | 220 public void testRevlogInspectors() throws Exception { // TODO move to better place |
221 HgRepository repository = Configuration.get().find("branches-1"); // any repo | 221 HgRepository repository = Configuration.get().find("branches-1"); // any repo |
222 repository.getChangelog().walk(0, TIP, new HgChangelog.RevisionInspector() { | 222 repository.getChangelog().indexWalk(0, TIP, new HgChangelog.RevisionInspector() { |
223 | 223 |
224 public void next(int localRevision, Nodeid revision, int linkedRevision) { | 224 public void next(int localRevision, Nodeid revision, int linkedRevision) { |
225 Assert.assertEquals(localRevision, linkedRevision); | 225 Assert.assertEquals(localRevision, linkedRevision); |
226 } | 226 } |
227 }); | 227 }); |
228 final HgDataFile fileNode = repository.getFileNode("file1"); | 228 final HgDataFile fileNode = repository.getFileNode("file1"); |
229 fileNode.walk(0, TIP, new HgDataFile.RevisionInspector() { | 229 fileNode.indexWalk(0, TIP, new HgDataFile.RevisionInspector() { |
230 int i = 0; | 230 int i = 0; |
231 | 231 |
232 public void next(int localRevision, Nodeid revision, int linkedRevision) { | 232 public void next(int localRevision, Nodeid revision, int linkedRevision) { |
233 Assert.assertEquals(i++, localRevision); | 233 Assert.assertEquals(i++, localRevision); |
234 Assert.assertEquals(fileNode.getChangesetRevisionIndex(localRevision), linkedRevision); | 234 Assert.assertEquals(fileNode.getChangesetRevisionIndex(localRevision), linkedRevision); |
235 Assert.assertEquals(fileNode.getRevision(localRevision), revision); | 235 Assert.assertEquals(fileNode.getRevision(localRevision), revision); |
236 } | 236 } |
237 }); | 237 }); |
238 fileNode.walk(0, TIP, new HgDataFile.ParentInspector() { | 238 fileNode.indexWalk(0, TIP, new HgDataFile.ParentInspector() { |
239 int i = 0; | 239 int i = 0; |
240 Nodeid[] all = new Nodeid[fileNode.getRevisionCount()]; | 240 Nodeid[] all = new Nodeid[fileNode.getRevisionCount()]; |
241 | 241 |
242 public void next(int localRevision, Nodeid revision, int parent1, int parent2, Nodeid nidParent1, Nodeid nidParent2) { | 242 public void next(int localRevision, Nodeid revision, int parent1, int parent2, Nodeid nidParent1, Nodeid nidParent2) { |
243 Assert.assertEquals(i++, localRevision); | 243 Assert.assertEquals(i++, localRevision); |