diff cmdline/org/tmatesoft/hg/console/Status.java @ 88:61eedab3eb3e

Status between two revisions to recognize copy/rename
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 26 Jan 2011 05:46:47 +0100
parents 6f1b88693d48
children d55d4eedfc57
line wrap: on
line diff
--- a/cmdline/org/tmatesoft/hg/console/Status.java	Wed Jan 26 01:07:26 2011 +0100
+++ b/cmdline/org/tmatesoft/hg/console/Status.java	Wed Jan 26 05:46:47 2011 +0100
@@ -29,6 +29,7 @@
 import org.tmatesoft.hg.repo.HgRepository;
 import org.tmatesoft.hg.repo.Internals;
 import org.tmatesoft.hg.repo.StatusCollector;
+import org.tmatesoft.hg.repo.StatusCollector.Record;
 import org.tmatesoft.hg.repo.WorkingCopyStatusCollector;
 
 /**
@@ -51,13 +52,18 @@
 		//
 //		new Internals(hgRepo).dumpDirstate();
 		//
-		mardu(hgRepo);
+		//statusWorkingCopy(hgRepo);
+		statusRevVsWorkingCopy(hgRepo);
 	}
-	
-	private static void mardu(HgRepository hgRepo) {
+
+	private static void statusWorkingCopy(HgRepository hgRepo) {
 		WorkingCopyStatusCollector wcc = new WorkingCopyStatusCollector(hgRepo);
 		StatusCollector.Record r = new StatusCollector.Record();
 		wcc.walk(TIP, r);
+		mardu(r);
+	}
+
+	private static void mardu(Record r) {
 		sortAndPrint('M', r.getModified());
 		sortAndPrint('A', r.getAdded(), r.getCopied());
 		sortAndPrint('R', r.getRemoved());
@@ -66,6 +72,13 @@
 //		sortAndPrint('C', r.getClean());
 		sortAndPrint('!', r.getMissing());
 	}
+	
+	private static void statusRevVsWorkingCopy(HgRepository hgRepo) {
+		WorkingCopyStatusCollector wcc = new WorkingCopyStatusCollector(hgRepo);
+		StatusCollector.Record r = new StatusCollector.Record();
+		wcc.walk(3, r);
+		mardu(r);
+	}
 
 	private static void bunchOfTests(HgRepository hgRepo) throws Exception {
 		Internals debug = new Internals(hgRepo);