Mercurial > hg4j
diff 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 |
line wrap: on
line diff
--- a/cmdline/org/tmatesoft/hg/console/Main.java Mon Sep 12 14:11:45 2011 +0200 +++ b/cmdline/org/tmatesoft/hg/console/Main.java Wed Sep 14 01:52:41 2011 +0200 @@ -40,6 +40,7 @@ import org.tmatesoft.hg.repo.HgBranches; import org.tmatesoft.hg.repo.HgChangelog; import org.tmatesoft.hg.repo.HgDataFile; +import org.tmatesoft.hg.repo.HgDirstate; import org.tmatesoft.hg.repo.HgInternals; import org.tmatesoft.hg.repo.HgManifest; import org.tmatesoft.hg.repo.HgMergeState; @@ -51,6 +52,8 @@ import org.tmatesoft.hg.repo.HgSubrepoLocation.Kind; import org.tmatesoft.hg.repo.HgWorkingCopyStatusCollector; import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; +import org.tmatesoft.hg.repo.HgDirstate.EntryKind; +import org.tmatesoft.hg.repo.HgDirstate.Record; import org.tmatesoft.hg.util.FileWalker; import org.tmatesoft.hg.util.Pair; import org.tmatesoft.hg.util.Path; @@ -86,12 +89,12 @@ // m.testParents(); // m.testEffectiveFileLog(); // m.testCatAtCsetRevision(); - m.testMergeState(); +// m.testMergeState(); // m.testFileStatus(); // m.dumpBranches(); // m.inflaterLengthException(); // m.dumpIgnored(); -// m.dumpDirstate(); + m.dumpDirstate(); // m.testStatusInternals(); // m.catCompleteHistory(); // m.dumpCompleteManifestLow(); @@ -325,6 +328,14 @@ private void dumpDirstate() { new HgInternals(hgRepo).dumpDirstate(); + HgWorkingCopyStatusCollector wcc = HgWorkingCopyStatusCollector.create(hgRepo, new Path.Matcher.Any()); + wcc.getDirstate().walk(new HgDirstate.Inspector() { + + public boolean next(EntryKind kind, Record entry) { + System.out.printf("%s %s\n", kind, entry.name()); + return true; + } + }); }