Mercurial > hg4j
comparison cmdline/org/tmatesoft/hg/console/Main.java @ 270:c6450b0b1fd5
Avoid IAE:nullid when looking into stale merge/state file
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 24 Aug 2011 04:10:17 +0200 |
parents | a620f0663a37 |
children | 6d1804fe0ed7 |
comparison
equal
deleted
inserted
replaced
269:7af843ecc378 | 270:c6450b0b1fd5 |
---|---|
75 System.out.println("REPO:" + hgRepo.getLocation()); | 75 System.out.println("REPO:" + hgRepo.getLocation()); |
76 } | 76 } |
77 | 77 |
78 public static void main(String[] args) throws Exception { | 78 public static void main(String[] args) throws Exception { |
79 Main m = new Main(args); | 79 Main m = new Main(args); |
80 m.testTreeTraversal(); | 80 // m.testTreeTraversal(); |
81 // m.testRevisionMap(); | 81 // m.testRevisionMap(); |
82 // m.testSubrepos(); | 82 // m.testSubrepos(); |
83 // m.testReadWorkingCopy(); | 83 // m.testReadWorkingCopy(); |
84 // m.testParents(); | 84 // m.testParents(); |
85 // m.testEffectiveFileLog(); | 85 // m.testEffectiveFileLog(); |
86 // m.testCatAtCsetRevision(); | 86 // m.testCatAtCsetRevision(); |
87 // m.testMergeState(); | 87 m.testMergeState(); |
88 // m.testFileStatus(); | 88 // m.testFileStatus(); |
89 // m.dumpBranches(); | 89 // m.dumpBranches(); |
90 // m.inflaterLengthException(); | 90 // m.inflaterLengthException(); |
91 // m.dumpIgnored(); | 91 // m.dumpIgnored(); |
92 // m.dumpDirstate(); | 92 // m.dumpDirstate(); |
245 } | 245 } |
246 | 246 |
247 private void testMergeState() throws Exception { | 247 private void testMergeState() throws Exception { |
248 final HgMergeState mergeState = hgRepo.getMergeState(); | 248 final HgMergeState mergeState = hgRepo.getMergeState(); |
249 mergeState.refresh(); | 249 mergeState.refresh(); |
250 System.out.printf("isMerging: %s, isStale: %s.\n", mergeState.isMerging(), mergeState.isStale()); | |
251 System.out.printf("P1:%s\nP2:%s\nState parent:%s\n",mergeState.getFirstParent().shortNotation(), mergeState.getSecondParent().shortNotation(), mergeState.getStateParent().shortNotation()); | |
250 for (HgMergeState.Entry e : mergeState.getConflicts()) { | 252 for (HgMergeState.Entry e : mergeState.getConflicts()) { |
251 System.out.println(e.getState() + " " + e.getActualFile()); | 253 System.out.println(e.getState() + " " + e.getActualFile()); |
252 System.out.println("p1: " + formatFileRevision(e.getFirstParent())); | 254 System.out.println("p1: " + formatFileRevision(e.getFirstParent())); |
253 System.out.println("p2: " + formatFileRevision(e.getSecondParent())); | 255 System.out.println("p2: " + formatFileRevision(e.getSecondParent())); |
254 System.out.println("ancestor: " + formatFileRevision(e.getCommonAncestor())); | 256 System.out.println("ancestor: " + formatFileRevision(e.getCommonAncestor())); |