comparison src/com/tmate/hgkit/console/Status.java @ 22:603806cd2dc6

Status of local working dir against non-tip base revision
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 06 Jan 2011 03:30:20 +0100
parents 11cfabe692b3
children 05829a70b30b
comparison
equal deleted inserted replaced
21:e929cecae4e1 22:603806cd2dc6
4 package com.tmate.hgkit.console; 4 package com.tmate.hgkit.console;
5 5
6 import static com.tmate.hgkit.ll.HgRepository.TIP; 6 import static com.tmate.hgkit.ll.HgRepository.TIP;
7 7
8 import com.tmate.hgkit.fs.RepositoryLookup; 8 import com.tmate.hgkit.fs.RepositoryLookup;
9 import com.tmate.hgkit.ll.HgDataFile;
9 import com.tmate.hgkit.ll.HgRepository; 10 import com.tmate.hgkit.ll.HgRepository;
10 import com.tmate.hgkit.ll.LocalHgRepo; 11 import com.tmate.hgkit.ll.LocalHgRepo;
12 import com.tmate.hgkit.ll.Nodeid;
11 13
12 /** 14 /**
13 * 15 *
14 * @author artem 16 * @author artem
15 */ 17 */
31 final int r1 = 0, r2 = 11; 33 final int r1 = 0, r2 = 11;
32 System.out.printf("Status for changes between revision %d and %d:\n", r1, r2); 34 System.out.printf("Status for changes between revision %d and %d:\n", r1, r2);
33 hgRepo.status(r1, r2, dump); 35 hgRepo.status(r1, r2, dump);
34 System.out.println("\nStatus against working dir:"); 36 System.out.println("\nStatus against working dir:");
35 ((LocalHgRepo) hgRepo).statusLocal(TIP, dump); 37 ((LocalHgRepo) hgRepo).statusLocal(TIP, dump);
38 System.out.println();
39 System.out.printf("Manifest of the revision %d:\n", r2);
40 hgRepo.getManifest().walk(r2, r2, new Manifest.Dump());
41 System.out.println();
42 System.out.printf("\nStatus of working dir against %d:\n", r2);
43 ((LocalHgRepo) hgRepo).statusLocal(r2, dump);
44 }
45
46 protected static void testStatusInternals(HgRepository hgRepo) {
47 HgDataFile n = hgRepo.getFileNode("design.txt");
48 for (String s : new String[] {"011dfd44417c72bd9e54cf89b82828f661b700ed", "e5529faa06d53e06a816e56d218115b42782f1ba", "c18e7111f1fc89a80a00f6a39d51288289a382fc"}) {
49 // expected: 359, 2123, 3079
50 byte[] b = s.getBytes();
51 final Nodeid nid = Nodeid.fromAscii(b, 0, b.length);
52 System.out.println(s + " : " + n.length(nid));
53 }
36 } 54 }
37 55
38 private static class StatusDump implements HgRepository.StatusInspector { 56 private static class StatusDump implements HgRepository.StatusInspector {
39 public boolean hideStatusPrefix = false; // hg status -n option 57 public boolean hideStatusPrefix = false; // hg status -n option
40 public boolean showCopied = true; // -C 58 public boolean showCopied = true; // -C