Mercurial > jhg
comparison cmdline/org/tmatesoft/hg/console/Main.java @ 290:8faad08c709b
Expose dirstate to allow pre-configuration of FileIterators for status collection in particular
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 14 Sep 2011 01:52:41 +0200 |
parents | 6dbbc53fc46d |
children | 981f9f50bb6c |
comparison
equal
deleted
inserted
replaced
289:086a326f181f | 290:8faad08c709b |
---|---|
38 import org.tmatesoft.hg.internal.PathGlobMatcher; | 38 import org.tmatesoft.hg.internal.PathGlobMatcher; |
39 import org.tmatesoft.hg.internal.RelativePathRewrite; | 39 import org.tmatesoft.hg.internal.RelativePathRewrite; |
40 import org.tmatesoft.hg.repo.HgBranches; | 40 import org.tmatesoft.hg.repo.HgBranches; |
41 import org.tmatesoft.hg.repo.HgChangelog; | 41 import org.tmatesoft.hg.repo.HgChangelog; |
42 import org.tmatesoft.hg.repo.HgDataFile; | 42 import org.tmatesoft.hg.repo.HgDataFile; |
43 import org.tmatesoft.hg.repo.HgDirstate; | |
43 import org.tmatesoft.hg.repo.HgInternals; | 44 import org.tmatesoft.hg.repo.HgInternals; |
44 import org.tmatesoft.hg.repo.HgManifest; | 45 import org.tmatesoft.hg.repo.HgManifest; |
45 import org.tmatesoft.hg.repo.HgMergeState; | 46 import org.tmatesoft.hg.repo.HgMergeState; |
46 import org.tmatesoft.hg.repo.HgRepository; | 47 import org.tmatesoft.hg.repo.HgRepository; |
47 import org.tmatesoft.hg.repo.HgStatusCollector; | 48 import org.tmatesoft.hg.repo.HgStatusCollector; |
49 import org.tmatesoft.hg.repo.HgSubrepoLocation; | 50 import org.tmatesoft.hg.repo.HgSubrepoLocation; |
50 import org.tmatesoft.hg.repo.HgManifest.Flags; | 51 import org.tmatesoft.hg.repo.HgManifest.Flags; |
51 import org.tmatesoft.hg.repo.HgSubrepoLocation.Kind; | 52 import org.tmatesoft.hg.repo.HgSubrepoLocation.Kind; |
52 import org.tmatesoft.hg.repo.HgWorkingCopyStatusCollector; | 53 import org.tmatesoft.hg.repo.HgWorkingCopyStatusCollector; |
53 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; | 54 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; |
55 import org.tmatesoft.hg.repo.HgDirstate.EntryKind; | |
56 import org.tmatesoft.hg.repo.HgDirstate.Record; | |
54 import org.tmatesoft.hg.util.FileWalker; | 57 import org.tmatesoft.hg.util.FileWalker; |
55 import org.tmatesoft.hg.util.Pair; | 58 import org.tmatesoft.hg.util.Pair; |
56 import org.tmatesoft.hg.util.Path; | 59 import org.tmatesoft.hg.util.Path; |
57 import org.tmatesoft.hg.util.PathRewrite; | 60 import org.tmatesoft.hg.util.PathRewrite; |
58 | 61 |
84 // m.testSubrepos(); | 87 // m.testSubrepos(); |
85 // m.testReadWorkingCopy(); | 88 // m.testReadWorkingCopy(); |
86 // m.testParents(); | 89 // m.testParents(); |
87 // m.testEffectiveFileLog(); | 90 // m.testEffectiveFileLog(); |
88 // m.testCatAtCsetRevision(); | 91 // m.testCatAtCsetRevision(); |
89 m.testMergeState(); | 92 // m.testMergeState(); |
90 // m.testFileStatus(); | 93 // m.testFileStatus(); |
91 // m.dumpBranches(); | 94 // m.dumpBranches(); |
92 // m.inflaterLengthException(); | 95 // m.inflaterLengthException(); |
93 // m.dumpIgnored(); | 96 // m.dumpIgnored(); |
94 // m.dumpDirstate(); | 97 m.dumpDirstate(); |
95 // m.testStatusInternals(); | 98 // m.testStatusInternals(); |
96 // m.catCompleteHistory(); | 99 // m.catCompleteHistory(); |
97 // m.dumpCompleteManifestLow(); | 100 // m.dumpCompleteManifestLow(); |
98 // m.dumpCompleteManifestHigh(); | 101 // m.dumpCompleteManifestHigh(); |
99 // m.bunchOfTests(); | 102 // m.bunchOfTests(); |
323 } | 326 } |
324 } | 327 } |
325 | 328 |
326 private void dumpDirstate() { | 329 private void dumpDirstate() { |
327 new HgInternals(hgRepo).dumpDirstate(); | 330 new HgInternals(hgRepo).dumpDirstate(); |
331 HgWorkingCopyStatusCollector wcc = HgWorkingCopyStatusCollector.create(hgRepo, new Path.Matcher.Any()); | |
332 wcc.getDirstate().walk(new HgDirstate.Inspector() { | |
333 | |
334 public boolean next(EntryKind kind, Record entry) { | |
335 System.out.printf("%s %s\n", kind, entry.name()); | |
336 return true; | |
337 } | |
338 }); | |
328 } | 339 } |
329 | 340 |
330 | 341 |
331 private void catCompleteHistory() throws Exception { | 342 private void catCompleteHistory() throws Exception { |
332 DigestHelper dh = new DigestHelper(); | 343 DigestHelper dh = new DigestHelper(); |