comparison cmdline/org/tmatesoft/hg/console/Main.java @ 229:1ec6b327a6ac

Scope for status reworked: explicit files or a general matcher
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 31 May 2011 05:23:07 +0200
parents 26ad7827a62d
children 1792b37650f2
comparison
equal deleted inserted replaced
228:fffe4f882248 229:1ec6b327a6ac
26 import org.tmatesoft.hg.core.HgLogCommand.FileRevision; 26 import org.tmatesoft.hg.core.HgLogCommand.FileRevision;
27 import org.tmatesoft.hg.core.HgManifestCommand; 27 import org.tmatesoft.hg.core.HgManifestCommand;
28 import org.tmatesoft.hg.core.Nodeid; 28 import org.tmatesoft.hg.core.Nodeid;
29 import org.tmatesoft.hg.internal.ByteArrayChannel; 29 import org.tmatesoft.hg.internal.ByteArrayChannel;
30 import org.tmatesoft.hg.internal.DigestHelper; 30 import org.tmatesoft.hg.internal.DigestHelper;
31 import org.tmatesoft.hg.internal.PathGlobMatcher;
31 import org.tmatesoft.hg.repo.HgBranches; 32 import org.tmatesoft.hg.repo.HgBranches;
32 import org.tmatesoft.hg.repo.HgDataFile; 33 import org.tmatesoft.hg.repo.HgDataFile;
33 import org.tmatesoft.hg.repo.HgInternals; 34 import org.tmatesoft.hg.repo.HgInternals;
34 import org.tmatesoft.hg.repo.HgManifest; 35 import org.tmatesoft.hg.repo.HgManifest;
35 import org.tmatesoft.hg.repo.HgRepository; 36 import org.tmatesoft.hg.repo.HgRepository;
73 // m.bunchOfTests(); 74 // m.bunchOfTests();
74 } 75 }
75 76
76 private void testFileStatus() { 77 private void testFileStatus() {
77 // final Path path = Path.create("src/org/tmatesoft/hg/util/"); 78 // final Path path = Path.create("src/org/tmatesoft/hg/util/");
78 final Path path = Path.create("src/org/tmatesoft/hg/internal/Experimental.java"); 79 // final Path path = Path.create("src/org/tmatesoft/hg/internal/Experimental.java");
79 HgWorkingCopyStatusCollector wcsc = HgWorkingCopyStatusCollector.create(hgRepo, path); 80 // final Path path = Path.create("dir/file3");
81 // HgWorkingCopyStatusCollector wcsc = HgWorkingCopyStatusCollector.create(hgRepo, path);
82 HgWorkingCopyStatusCollector wcsc = HgWorkingCopyStatusCollector.create(hgRepo, new PathGlobMatcher("*"));
80 wcsc.walk(TIP, new StatusDump()); 83 wcsc.walk(TIP, new StatusDump());
84 new HgManifestCommand(hgRepo).dirs(true).revision(TIP).execute(new HgManifestCommand.Handler() {
85
86 public void file(FileRevision fileRevision) {
87 }
88
89 public void end(Nodeid manifestRevision) {
90 }
91
92 public void dir(Path p) {
93 System.out.println(p);
94 }
95
96 public void begin(Nodeid manifestRevision) {
97 }
98 });
81 } 99 }
82 100
83 private void dumpBranches() { 101 private void dumpBranches() {
84 HgBranches b = hgRepo.getBranches(); 102 HgBranches b = hgRepo.getBranches();
85 for (HgBranches.BranchInfo bi : b.getAllBranches()) { 103 for (HgBranches.BranchInfo bi : b.getAllBranches()) {