Mercurial > hg4j
comparison cmdline/org/tmatesoft/hg/console/Main.java @ 237:6e1373b54e9b
Allow access to working copy content through HgDataFile. Give access to repository's working dir
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 10 Jun 2011 04:35:21 +0200 |
parents | 883300108179 |
children | df9d2854d3d6 |
comparison
equal
deleted
inserted
replaced
236:883300108179 | 237:6e1373b54e9b |
---|---|
68 System.out.println("REPO:" + hgRepo.getLocation()); | 68 System.out.println("REPO:" + hgRepo.getLocation()); |
69 } | 69 } |
70 | 70 |
71 public static void main(String[] args) throws Exception { | 71 public static void main(String[] args) throws Exception { |
72 Main m = new Main(args); | 72 Main m = new Main(args); |
73 m.testReadWorkingCopy(); | |
73 // m.testParents(); | 74 // m.testParents(); |
74 // m.testEffectiveFileLog(); | 75 // m.testEffectiveFileLog(); |
75 // m.testCatAtCsetRevision(); | 76 // m.testCatAtCsetRevision(); |
76 // m.testMergeState(); | 77 // m.testMergeState(); |
77 // m.testFileStatus(); | 78 // m.testFileStatus(); |
78 m.dumpBranches(); | 79 // m.dumpBranches(); |
79 // m.inflaterLengthException(); | 80 // m.inflaterLengthException(); |
80 // m.dumpIgnored(); | 81 // m.dumpIgnored(); |
81 // m.dumpDirstate(); | 82 // m.dumpDirstate(); |
82 // m.testStatusInternals(); | 83 // m.testStatusInternals(); |
83 // m.catCompleteHistory(); | 84 // m.catCompleteHistory(); |
84 // m.dumpCompleteManifestLow(); | 85 // m.dumpCompleteManifestLow(); |
85 // m.dumpCompleteManifestHigh(); | 86 // m.dumpCompleteManifestHigh(); |
86 // m.bunchOfTests(); | 87 // m.bunchOfTests(); |
88 } | |
89 | |
90 private void testReadWorkingCopy() throws Exception { | |
91 for (String fname : cmdLineOpts.getList("")) { | |
92 HgDataFile fn = hgRepo.getFileNode(fname); | |
93 ByteArrayChannel sink = new ByteArrayChannel(); | |
94 fn.workingCopy(sink); | |
95 System.out.printf("%s: read %d bytes of working copy", fname, sink.toArray().length); | |
96 } | |
87 } | 97 } |
88 | 98 |
89 private void testParents() throws Exception { | 99 private void testParents() throws Exception { |
90 // hg parents cmd | 100 // hg parents cmd |
91 final Pair<Nodeid, Nodeid> wcParents = hgRepo.getWorkingCopyParents(); | 101 final Pair<Nodeid, Nodeid> wcParents = hgRepo.getWorkingCopyParents(); |