comparison cmdline/org/tmatesoft/hg/console/Bundle.java @ 628:6526d8adbc0f

Explicit HgRuntimeException to facilitate easy switch from runtime to checked exceptions
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 22 May 2013 15:52:31 +0200
parents 9c9c442b5f2e
children
comparison
equal deleted inserted replaced
627:5153eb73b18d 628:6526d8adbc0f
27 import org.tmatesoft.hg.repo.HgLookup; 27 import org.tmatesoft.hg.repo.HgLookup;
28 import org.tmatesoft.hg.repo.HgRepository; 28 import org.tmatesoft.hg.repo.HgRepository;
29 import org.tmatesoft.hg.repo.HgBundle.GroupElement; 29 import org.tmatesoft.hg.repo.HgBundle.GroupElement;
30 import org.tmatesoft.hg.repo.HgBundle.Inspector; 30 import org.tmatesoft.hg.repo.HgBundle.Inspector;
31 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; 31 import org.tmatesoft.hg.repo.HgChangelog.RawChangeset;
32 import org.tmatesoft.hg.repo.HgRuntimeException;
32 33
33 34
34 /** 35 /**
35 * WORK IN PROGRESS, DO NOT USE 36 * WORK IN PROGRESS, DO NOT USE
36 * 37 *
58 -Changeset {User: ..., Comment: Record possible...} 59 -Changeset {User: ..., Comment: Record possible...}
59 */ 60 */
60 hgBundle.changes(hgRepo, new HgChangelog.Inspector() { 61 hgBundle.changes(hgRepo, new HgChangelog.Inspector() {
61 private final HgChangelog changelog = hgRepo.getChangelog(); 62 private final HgChangelog changelog = hgRepo.getChangelog();
62 63
63 public void next(int revisionNumber, Nodeid nodeid, RawChangeset cset) { 64 public void next(int revisionNumber, Nodeid nodeid, RawChangeset cset) throws HgRuntimeException {
64 if (changelog.isKnown(nodeid)) { 65 if (changelog.isKnown(nodeid)) {
65 System.out.print("+"); 66 System.out.print("+");
66 } else { 67 } else {
67 System.out.print("-"); 68 System.out.print("-");
68 } 69 }
97 158: 31328 0 247 665 155 158 157 -1 b413b16d10a50cc027f4c38e4df5a9fedd618a79 98 158: 31328 0 247 665 155 158 157 -1 b413b16d10a50cc027f4c38e4df5a9fedd618a79
98 99
99 100
100 */ 101 */
101 102
102 public static void dump(HgBundle hgBundle) throws HgException { 103 public static void dump(HgBundle hgBundle) throws HgException, HgRuntimeException {
103 Dump dump = new Dump(); 104 Dump dump = new Dump();
104 hgBundle.inspectAll(dump); 105 hgBundle.inspectAll(dump);
105 System.out.println("Total files:" + dump.names.size()); 106 System.out.println("Total files:" + dump.names.size());
106 for (String s : dump.names) { 107 for (String s : dump.names) {
107 System.out.println(s); 108 System.out.println(s);