Mercurial > hg4j
comparison cmdline/org/tmatesoft/hg/console/Main.java @ 339:863356c2847e
Issue 16: respect glob patterns in HgIgnore for sub-directories
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 16 Nov 2011 22:42:21 +0100 |
parents | a674b8590362 |
children | a54bfe0db959 |
comparison
equal
deleted
inserted
replaced
338:3cfa4d908fc9 | 339:863356c2847e |
---|---|
47 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; | 47 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; |
48 import org.tmatesoft.hg.repo.HgDataFile; | 48 import org.tmatesoft.hg.repo.HgDataFile; |
49 import org.tmatesoft.hg.repo.HgDirstate; | 49 import org.tmatesoft.hg.repo.HgDirstate; |
50 import org.tmatesoft.hg.repo.HgDirstate.EntryKind; | 50 import org.tmatesoft.hg.repo.HgDirstate.EntryKind; |
51 import org.tmatesoft.hg.repo.HgDirstate.Record; | 51 import org.tmatesoft.hg.repo.HgDirstate.Record; |
52 import org.tmatesoft.hg.repo.HgIgnore; | |
52 import org.tmatesoft.hg.repo.HgInternals; | 53 import org.tmatesoft.hg.repo.HgInternals; |
53 import org.tmatesoft.hg.repo.HgManifest; | 54 import org.tmatesoft.hg.repo.HgManifest; |
54 import org.tmatesoft.hg.repo.HgManifest.Flags; | 55 import org.tmatesoft.hg.repo.HgManifest.Flags; |
55 import org.tmatesoft.hg.repo.HgMergeState; | 56 import org.tmatesoft.hg.repo.HgMergeState; |
56 import org.tmatesoft.hg.repo.HgRepository; | 57 import org.tmatesoft.hg.repo.HgRepository; |
87 System.out.println("REPO:" + hgRepo.getLocation()); | 88 System.out.println("REPO:" + hgRepo.getLocation()); |
88 } | 89 } |
89 | 90 |
90 public static void main(String[] args) throws Exception { | 91 public static void main(String[] args) throws Exception { |
91 Main m = new Main(args); | 92 Main m = new Main(args); |
92 m.buildFileLog(); | 93 // m.buildFileLog(); |
93 // m.testConsoleLog(); | 94 // m.testConsoleLog(); |
94 // m.testTreeTraversal(); | 95 // m.testTreeTraversal(); |
95 // m.testRevisionMap(); | 96 // m.testRevisionMap(); |
96 // m.testSubrepos(); | 97 // m.testSubrepos(); |
97 // m.testReadWorkingCopy(); | 98 // m.testReadWorkingCopy(); |
98 // m.testParents(); | 99 // m.testParents(); |
99 // m.testEffectiveFileLog(); | 100 // m.testEffectiveFileLog(); |
100 // m.testCatAtCsetRevision(); | 101 // m.testCatAtCsetRevision(); |
101 // m.testMergeState(); | 102 m.testMergeState(); |
102 // m.testFileStatus(); | 103 // m.testFileStatus(); |
103 // m.dumpBranches(); | 104 // m.dumpBranches(); |
104 // m.inflaterLengthException(); | 105 // m.inflaterLengthException(); |
105 // m.dumpIgnored(); | 106 // m.dumpIgnored(); |
106 // m.dumpDirstate(); | 107 // m.dumpDirstate(); |
411 f2.content(0, bac = new ByteArrayChannel()); // 0: 14269 | 412 f2.content(0, bac = new ByteArrayChannel()); // 0: 14269 |
412 System.out.println(bac.toArray().length); | 413 System.out.println(bac.toArray().length); |
413 } | 414 } |
414 | 415 |
415 private void dumpIgnored() { | 416 private void dumpIgnored() { |
416 HgInternals debug = new HgInternals(hgRepo); | |
417 String[] toCheck = new String[] {"design.txt", "src/com/tmate/hgkit/ll/Changelog.java", "src/Extras.java", "bin/com/tmate/hgkit/ll/Changelog.class"}; | 417 String[] toCheck = new String[] {"design.txt", "src/com/tmate/hgkit/ll/Changelog.java", "src/Extras.java", "bin/com/tmate/hgkit/ll/Changelog.class"}; |
418 boolean[] checkResult = debug.checkIgnored(toCheck); | 418 HgIgnore ignore = hgRepo.getIgnore(); |
419 for (int i = 0; i < toCheck.length; i++) { | 419 for (int i = 0; i < toCheck.length; i++) { |
420 System.out.println("Ignored " + toCheck[i] + ": " + checkResult[i]); | 420 System.out.println("Ignored " + toCheck[i] + ": " + ignore.isIgnored(Path.create(toCheck[i]))); |
421 } | 421 } |
422 } | 422 } |
423 | 423 |
424 private void dumpDirstate() { | 424 private void dumpDirstate() { |
425 new HgInternals(hgRepo).dumpDirstate(); | 425 new HgInternals(hgRepo).dumpDirstate(); |