comparison cmdline/org/tmatesoft/hg/console/Status.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 150500515714
children 36fd1fd06492
comparison
equal deleted inserted replaced
426:063b0663495a 427:31a89587eb04
72 class StatusHandler implements HgStatusHandler { 72 class StatusHandler implements HgStatusHandler {
73 73
74 final EnumMap<HgStatus.Kind, List<Path>> data = new EnumMap<HgStatus.Kind, List<Path>>(HgStatus.Kind.class); 74 final EnumMap<HgStatus.Kind, List<Path>> data = new EnumMap<HgStatus.Kind, List<Path>>(HgStatus.Kind.class);
75 final Map<Path, Path> copies = showCopies ? new HashMap<Path,Path>() : null; 75 final Map<Path, Path> copies = showCopies ? new HashMap<Path,Path>() : null;
76 76
77 public void handleStatus(HgStatus s) { 77 public void status(HgStatus s) {
78 List<Path> l = data.get(s.getKind()); 78 List<Path> l = data.get(s.getKind());
79 if (l == null) { 79 if (l == null) {
80 l = new LinkedList<Path>(); 80 l = new LinkedList<Path>();
81 data.put(s.getKind(), l); 81 data.put(s.getKind(), l);
82 } 82 }
84 if (s.isCopy() && showCopies) { 84 if (s.isCopy() && showCopies) {
85 copies.put(s.getPath(), s.getOriginalPath()); 85 copies.put(s.getPath(), s.getOriginalPath());
86 } 86 }
87 } 87 }
88 88
89 public void handleError(Path file, org.tmatesoft.hg.util.Status s) { 89 public void error(Path file, org.tmatesoft.hg.util.Status s) {
90 System.out.printf("FAILURE: %s %s\n", s.getMessage(), file); 90 System.out.printf("FAILURE: %s %s\n", s.getMessage(), file);
91 s.getException().printStackTrace(System.out); 91 s.getException().printStackTrace(System.out);
92 } 92 }
93 93
94 public void dump() { 94 public void dump() {