comparison src/com/tmate/hgkit/console/Cat.java @ 59:b771e94a4f7c

Introduce Internals to keep LocalHgRepo casts and alike in a single place. WCSC optionally to reuse SC data
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 18 Jan 2011 00:08:15 +0100
parents 92c3d0920d58
children
comparison
equal deleted inserted replaced
58:4cfc47bc14cc 59:b771e94a4f7c
4 package com.tmate.hgkit.console; 4 package com.tmate.hgkit.console;
5 5
6 import com.tmate.hgkit.fs.RepositoryLookup; 6 import com.tmate.hgkit.fs.RepositoryLookup;
7 import com.tmate.hgkit.ll.DigestHelper; 7 import com.tmate.hgkit.ll.DigestHelper;
8 import com.tmate.hgkit.ll.HgDataFile; 8 import com.tmate.hgkit.ll.HgDataFile;
9 import com.tmate.hgkit.ll.HgIgnore;
10 import com.tmate.hgkit.ll.HgRepository; 9 import com.tmate.hgkit.ll.HgRepository;
11 import com.tmate.hgkit.ll.LocalHgRepo; 10 import com.tmate.hgkit.ll.Internals;
12 11
13 /** 12 /**
14 * @author artem 13 * @author artem
15 * 14 *
16 */ 15 */
22 HgRepository hgRepo = repoLookup.detect(cmdLineOpts); 21 HgRepository hgRepo = repoLookup.detect(cmdLineOpts);
23 if (hgRepo.isInvalid()) { 22 if (hgRepo.isInvalid()) {
24 System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation()); 23 System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation());
25 return; 24 return;
26 } 25 }
27 HgIgnore ignore = ((LocalHgRepo) hgRepo).loadIgnore(); 26 Internals debug = new Internals(hgRepo);
28 for (String s : new String[] {"design.txt", "src/com/tmate/hgkit/ll/Changelog.java", "src/Extras.java", "bin/com/tmate/hgkit/ll/Changelog.class"} ) { 27 String[] toCheck = new String[] {"design.txt", "src/com/tmate/hgkit/ll/Changelog.java", "src/Extras.java", "bin/com/tmate/hgkit/ll/Changelog.class"};
29 System.out.println("Ignored " + s + ": " + ignore.isIgnored(s)); 28 boolean[] checkResult = debug.checkIgnored(toCheck);
29 for (int i = 0; i < toCheck.length; i++) {
30 System.out.println("Ignored " + toCheck[i] + ": " + checkResult[i]);
30 } 31 }
31 DigestHelper dh = new DigestHelper(); 32 DigestHelper dh = new DigestHelper();
32 for (String fname : cmdLineOpts.files) { 33 for (String fname : cmdLineOpts.files) {
33 System.out.println(fname); 34 System.out.println(fname);
34 HgDataFile fn = hgRepo.getFileNode(fname); 35 HgDataFile fn = hgRepo.getFileNode(fname);