diff cmdline/org/tmatesoft/hg/console/Main.java @ 516:0ae5768081aa

Allow walking file rename history independently from file ancestry (native hg log --follow does both at once)
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 18 Dec 2012 18:57:03 +0100
parents e6c8b9b654b2
children 0be5be8d57e9
line wrap: on
line diff
--- a/cmdline/org/tmatesoft/hg/console/Main.java	Mon Dec 17 20:51:12 2012 +0100
+++ b/cmdline/org/tmatesoft/hg/console/Main.java	Tue Dec 18 18:57:03 2012 +0100
@@ -174,7 +174,7 @@
 	private void buildFileLog() throws Exception {
 		final long start = System.nanoTime();
 		HgLogCommand cmd = new HgLogCommand(hgRepo);
-		cmd.file("file1b.txt", true);
+		cmd.file("file1b.txt", true, true);
 		final int[] count = new int[] { 0 };
 		class MyHandler implements HgChangesetTreeHandler, Adaptable {
 			public void treeElement(HgChangesetTreeHandler.TreeElement entry) {
@@ -191,8 +191,11 @@
 				final boolean isFork = entry.children().size() > 1;
 				final HgChangeset cset = entry.changeset();
 				System.out.printf("%d:%s - %s (%s)\n", cset.getRevisionIndex(), cset.getNodeid().shortNotation(), cset.getComment(), cset.getPhase());
-				System.out.printf("Known as %s (file rev:%s)\n", entry.file().getPath(), entry.fileRevision().shortNotation());
+				System.out.printf("\tKnown as %s (file rev:%s)\n", entry.file().getPath(), entry.fileRevision().shortNotation());
 				if (!isJoin && !isFork && !entry.children().isEmpty()) {
+					HgChangeset p1 = entry.parents().first();
+					HgChangeset p2 = entry.parents().second();
+					System.out.printf("\tp1:%d, p2:%d\n", p1 == null ? -1 : p1.getRevisionIndex(), p2 == null ? -1 : p2.getRevisionIndex());
 					System.out.printf("\t=> %s\n", sb);
 				}
 				if (isJoin) {