diff src/com/tmate/hgkit/console/Log.java @ 2:08db726a0fb7

Shaping out low-level Hg structures
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Sun, 19 Dec 2010 05:41:31 +0100
parents a3576694a4d1
children 24bb4f365164
line wrap: on
line diff
--- a/src/com/tmate/hgkit/console/Log.java	Sat Dec 18 05:47:35 2010 +0100
+++ b/src/com/tmate/hgkit/console/Log.java	Sun Dec 19 05:41:31 2010 +0100
@@ -3,7 +3,9 @@
  */
 package com.tmate.hgkit.console;
 
-import com.tmate.hgkit.fs.RepositoryFinder;
+import com.tmate.hgkit.fs.RepositoryLookup;
+import com.tmate.hgkit.ll.Changeset;
+import com.tmate.hgkit.ll.HgDataFile;
 import com.tmate.hgkit.ll.HgRepository;
 
 /**
@@ -12,15 +14,28 @@
 public class Log {
 
 	public static void main(String[] args) throws Exception {
-		RepositoryFinder repoLookup = new RepositoryFinder();
+		RepositoryLookup repoLookup = new RepositoryLookup();
 		HgRepository hgRepo = repoLookup.detect(args);
 		if (hgRepo.isInvalid()) {
 			System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation());
 			return;
 		}
 		System.out.println(hgRepo.getLocation());
+		final Changeset.Callback callback = new Changeset.Callback() {
+			
+			public void next(Changeset cset) {
+				System.out.println();
+			}
+		};
+		HgDataFile f1 = hgRepo.getFileNode("hello.c");
+		System.out.println("Complete of a file:");
+		f1.history(callback);
+		System.out.println("Range 1-3:");
+		f1.history(1,3, callback);
+		//
+		System.out.println("Complete of a repo:");
+		hgRepo.getChangelog().all(callback);
 		//new ChangelogWalker().setFile("hello.c").setRevisionRange(1, 4).accept(new Visitor);
-
 	}
 
 }