Mercurial > jhg
diff src/com/tmate/hgkit/console/Status.java @ 58:4cfc47bc14cc
Status against local working dir extracted into distinct class. Iterating over local files extracted for ease of os-dependant patching
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Mon, 17 Jan 2011 23:01:19 +0100 |
parents | 8b0d6f1bd6b4 |
children | b771e94a4f7c |
line wrap: on
line diff
--- a/src/com/tmate/hgkit/console/Status.java Mon Jan 17 05:54:25 2011 +0100 +++ b/src/com/tmate/hgkit/console/Status.java Mon Jan 17 23:01:19 2011 +0100 @@ -15,6 +15,7 @@ import com.tmate.hgkit.ll.LocalHgRepo; import com.tmate.hgkit.ll.Nodeid; import com.tmate.hgkit.ll.StatusCollector; +import com.tmate.hgkit.ll.WorkingCopyStatusCollector; /** * @@ -49,13 +50,21 @@ System.out.println("\n\nTry hg status --change <rev>:"); sc.change(0, dump); System.out.println("\nStatus against working dir:"); - ((LocalHgRepo) hgRepo).statusLocal(TIP, dump); + WorkingCopyStatusCollector wcc = new WorkingCopyStatusCollector(hgRepo, ((LocalHgRepo) hgRepo).createWorkingDirWalker()); + wcc.walk(TIP, dump); System.out.println(); System.out.printf("Manifest of the revision %d:\n", r2); hgRepo.getManifest().walk(r2, r2, new Manifest.Dump()); System.out.println(); System.out.printf("\nStatus of working dir against %d:\n", r2); - ((LocalHgRepo) hgRepo).statusLocal(r2, dump); + r = wcc.status(r2); + sortAndPrint('M', r.getModified()); + sortAndPrint('A', r.getAdded()); + sortAndPrint('R', r.getRemoved()); + sortAndPrint('?', r.getUnknown()); + sortAndPrint('I', r.getIgnored()); + sortAndPrint('C', r.getClean()); + sortAndPrint('!', r.getMissing()); } private static void sortAndPrint(char prefix, List<String> ul) {