comparison cmdline/org/tmatesoft/hg/console/Status.java @ 88:61eedab3eb3e

Status between two revisions to recognize copy/rename
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 26 Jan 2011 05:46:47 +0100
parents 6f1b88693d48
children d55d4eedfc57
comparison
equal deleted inserted replaced
87:25f2e5d1cd8b 88:61eedab3eb3e
27 import org.tmatesoft.hg.core.Path; 27 import org.tmatesoft.hg.core.Path;
28 import org.tmatesoft.hg.repo.HgDataFile; 28 import org.tmatesoft.hg.repo.HgDataFile;
29 import org.tmatesoft.hg.repo.HgRepository; 29 import org.tmatesoft.hg.repo.HgRepository;
30 import org.tmatesoft.hg.repo.Internals; 30 import org.tmatesoft.hg.repo.Internals;
31 import org.tmatesoft.hg.repo.StatusCollector; 31 import org.tmatesoft.hg.repo.StatusCollector;
32 import org.tmatesoft.hg.repo.StatusCollector.Record;
32 import org.tmatesoft.hg.repo.WorkingCopyStatusCollector; 33 import org.tmatesoft.hg.repo.WorkingCopyStatusCollector;
33 34
34 /** 35 /**
35 * 36 *
36 * @author Artem Tikhomirov 37 * @author Artem Tikhomirov
49 // 50 //
50 // bunchOfTests(hgRepo); 51 // bunchOfTests(hgRepo);
51 // 52 //
52 // new Internals(hgRepo).dumpDirstate(); 53 // new Internals(hgRepo).dumpDirstate();
53 // 54 //
54 mardu(hgRepo); 55 //statusWorkingCopy(hgRepo);
56 statusRevVsWorkingCopy(hgRepo);
55 } 57 }
56 58
57 private static void mardu(HgRepository hgRepo) { 59 private static void statusWorkingCopy(HgRepository hgRepo) {
58 WorkingCopyStatusCollector wcc = new WorkingCopyStatusCollector(hgRepo); 60 WorkingCopyStatusCollector wcc = new WorkingCopyStatusCollector(hgRepo);
59 StatusCollector.Record r = new StatusCollector.Record(); 61 StatusCollector.Record r = new StatusCollector.Record();
60 wcc.walk(TIP, r); 62 wcc.walk(TIP, r);
63 mardu(r);
64 }
65
66 private static void mardu(Record r) {
61 sortAndPrint('M', r.getModified()); 67 sortAndPrint('M', r.getModified());
62 sortAndPrint('A', r.getAdded(), r.getCopied()); 68 sortAndPrint('A', r.getAdded(), r.getCopied());
63 sortAndPrint('R', r.getRemoved()); 69 sortAndPrint('R', r.getRemoved());
64 sortAndPrint('?', r.getUnknown()); 70 sortAndPrint('?', r.getUnknown());
65 // sortAndPrint('I', r.getIgnored()); 71 // sortAndPrint('I', r.getIgnored());
66 // sortAndPrint('C', r.getClean()); 72 // sortAndPrint('C', r.getClean());
67 sortAndPrint('!', r.getMissing()); 73 sortAndPrint('!', r.getMissing());
74 }
75
76 private static void statusRevVsWorkingCopy(HgRepository hgRepo) {
77 WorkingCopyStatusCollector wcc = new WorkingCopyStatusCollector(hgRepo);
78 StatusCollector.Record r = new StatusCollector.Record();
79 wcc.walk(3, r);
80 mardu(r);
68 } 81 }
69 82
70 private static void bunchOfTests(HgRepository hgRepo) throws Exception { 83 private static void bunchOfTests(HgRepository hgRepo) throws Exception {
71 Internals debug = new Internals(hgRepo); 84 Internals debug = new Internals(hgRepo);
72 debug.dumpDirstate(); 85 debug.dumpDirstate();