comparison cmdline/org/tmatesoft/hg/console/Main.java @ 427:31a89587eb04

FIXMEs: consistent names, throws for commands and their handlers. Use of checked exceptions in hi-level api
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 29 Mar 2012 17:14:35 +0200
parents 063b0663495a
children cd658b24a620
comparison
equal deleted inserted replaced
426:063b0663495a 427:31a89587eb04
26 import java.util.HashSet; 26 import java.util.HashSet;
27 import java.util.List; 27 import java.util.List;
28 import java.util.Map; 28 import java.util.Map;
29 29
30 import org.junit.Assert; 30 import org.junit.Assert;
31 import org.tmatesoft.hg.core.HgManifestHandler;
31 import org.tmatesoft.hg.core.HgCallbackTargetException; 32 import org.tmatesoft.hg.core.HgCallbackTargetException;
32 import org.tmatesoft.hg.core.HgCatCommand; 33 import org.tmatesoft.hg.core.HgCatCommand;
33 import org.tmatesoft.hg.core.HgChangeset; 34 import org.tmatesoft.hg.core.HgChangeset;
34 import org.tmatesoft.hg.core.HgChangesetFileSneaker; 35 import org.tmatesoft.hg.core.HgChangesetFileSneaker;
35 import org.tmatesoft.hg.core.HgChangesetTreeHandler; 36 import org.tmatesoft.hg.core.HgChangesetTreeHandler;
173 174
174 private void buildFileLog() throws Exception { 175 private void buildFileLog() throws Exception {
175 HgLogCommand cmd = new HgLogCommand(hgRepo); 176 HgLogCommand cmd = new HgLogCommand(hgRepo);
176 cmd.file("file1", false); 177 cmd.file("file1", false);
177 cmd.execute(new HgChangesetTreeHandler() { 178 cmd.execute(new HgChangesetTreeHandler() {
178 public void next(HgChangesetTreeHandler.TreeElement entry) { 179 public void treeElement(HgChangesetTreeHandler.TreeElement entry) {
179 StringBuilder sb = new StringBuilder(); 180 StringBuilder sb = new StringBuilder();
180 HashSet<Nodeid> test = new HashSet<Nodeid>(entry.childRevisions()); 181 HashSet<Nodeid> test = new HashSet<Nodeid>(entry.childRevisions());
181 for (HgChangeset cc : entry.children()) { 182 for (HgChangeset cc : entry.children()) {
182 sb.append(cc.getRevisionIndex()); 183 sb.append(cc.getRevisionIndex());
183 sb.append(':'); 184 sb.append(':');
556 return true; 557 return true;
557 } 558 }
558 } 559 }
559 560
560 private void dumpCompleteManifestHigh() throws Exception { 561 private void dumpCompleteManifestHigh() throws Exception {
561 new HgManifestCommand(hgRepo).dirs(true).execute(new HgManifestCommand.Handler() { 562 new HgManifestCommand(hgRepo).dirs(true).execute(new HgManifestHandler() {
562 563
563 public void begin(Nodeid manifestRevision) { 564 public void begin(Nodeid manifestRevision) {
564 System.out.println(">> " + manifestRevision); 565 System.out.println(">> " + manifestRevision);
565 } 566 }
566 public void dir(Path p) { 567 public void dir(Path p) {