Mercurial > hg4j
diff cmdline/org/tmatesoft/hg/console/Status.java @ 360:150500515714
Report non-critical errors during status operation to handler/inspector
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Thu, 08 Dec 2011 22:19:27 +0100 |
parents | 45dc79e545f5 |
children | 31a89587eb04 |
line wrap: on
line diff
--- a/cmdline/org/tmatesoft/hg/console/Status.java Thu Dec 08 15:34:13 2011 +0100 +++ b/cmdline/org/tmatesoft/hg/console/Status.java Thu Dec 08 22:19:27 2011 +0100 @@ -32,6 +32,7 @@ import org.tmatesoft.hg.core.HgStatus; import org.tmatesoft.hg.core.HgStatus.Kind; import org.tmatesoft.hg.core.HgStatusCommand; +import org.tmatesoft.hg.core.HgStatusHandler; import org.tmatesoft.hg.util.Path; /** @@ -68,7 +69,7 @@ // cmd.subrepo(cmdLineOpts.getBoolean("-S", "--subrepos")) final boolean noStatusPrefix = cmdLineOpts.getBoolean("-n", "--no-status"); final boolean showCopies = cmdLineOpts.getBoolean("-C", "--copies"); - class StatusHandler implements HgStatusCommand.Handler { + class StatusHandler implements HgStatusHandler { final EnumMap<HgStatus.Kind, List<Path>> data = new EnumMap<HgStatus.Kind, List<Path>>(HgStatus.Kind.class); final Map<Path, Path> copies = showCopies ? new HashMap<Path,Path>() : null; @@ -85,6 +86,11 @@ } } + public void handleError(Path file, org.tmatesoft.hg.util.Status s) { + System.out.printf("FAILURE: %s %s\n", s.getMessage(), file); + s.getException().printStackTrace(System.out); + } + public void dump() { sortAndPrint('M', data.get(Kind.Modified), null); sortAndPrint('A', data.get(Kind.Added), copies);