diff cmdline/org/tmatesoft/hg/console/Log.java @ 142:37a34044e6bd

More reasonable use of path normalizer and path.source
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 17 Feb 2011 05:06:07 +0100
parents 4a948ec83980
children b9700740553a
line wrap: on
line diff
--- a/cmdline/org/tmatesoft/hg/console/Log.java	Thu Feb 17 04:08:34 2011 +0100
+++ b/cmdline/org/tmatesoft/hg/console/Log.java	Thu Feb 17 05:06:07 2011 +0100
@@ -24,7 +24,6 @@
 import org.tmatesoft.hg.core.HgLogCommand;
 import org.tmatesoft.hg.core.HgLogCommand.FileRevision;
 import org.tmatesoft.hg.core.Nodeid;
-import org.tmatesoft.hg.repo.HgChangelog;
 import org.tmatesoft.hg.repo.HgDataFile;
 import org.tmatesoft.hg.repo.HgRepository;
 import org.tmatesoft.hg.util.Path;
@@ -82,16 +81,15 @@
 			for (String fname : cmdLineOpts.files) {
 				HgDataFile f1 = hgRepo.getFileNode(fname);
 				System.out.println("History of the file: " + f1.getPath());
-				String normalizesName = hgRepo.getPathHelper().rewrite(fname);
 				if (cmdLineOpts.limit == -1) {
-					cmd.file(Path.create(normalizesName), true).execute(dump);
+					cmd.file(f1.getPath(), true).execute(dump);
 				} else {
 					int[] r = new int[] { 0, f1.getRevisionCount() };
 					if (fixRange(r, dump.reverseOrder, cmdLineOpts.limit) == 0) {
 						System.out.println("No changes");
 						continue;
 					}
-					cmd.range(r[0], r[1]).file(Path.create(normalizesName), true).execute(dump);
+					cmd.range(r[0], r[1]).file(f1.getPath(), true).execute(dump);
 				}
 				dump.complete();
 			}
@@ -123,12 +121,12 @@
 		// own
 		private LinkedList<String> l = new LinkedList<String>();
 		private final HgRepository repo;
-		private HgChangelog.ParentWalker changelogWalker;
+//		private HgChangelog.ParentWalker changelogWalker;
 		private final int tip ;
 
 		public Dump(HgRepository hgRepo) {
 			repo = hgRepo;
-			tip = hgRepo.getChangelog().getRevisionCount() - 1;
+			tip = hgRepo.getChangelog().getLastRevision();
 		}
 		
 		public void copy(FileRevision from, FileRevision to) {
@@ -155,7 +153,7 @@
 				System.out.print(s);
 			}
 			l.clear();
-			changelogWalker = null;
+//			changelogWalker = null;
 		}
 
 		private String print(HgChangeset cset) {