diff src/com/tmate/hgkit/ll/HgDataFile.java @ 48:e34f90b9ded1

Limit option for history/log
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Fri, 14 Jan 2011 23:22:20 +0100
parents e45e75e22523
children 26e3eeaa3962
line wrap: on
line diff
--- a/src/com/tmate/hgkit/ll/HgDataFile.java	Fri Jan 14 20:03:14 2011 +0100
+++ b/src/com/tmate/hgkit/ll/HgDataFile.java	Fri Jan 14 23:22:20 2011 +0100
@@ -42,10 +42,14 @@
 	}
 
 	public void history(Changeset.Inspector inspector) {
+		history(0, content.revisionCount() - 1, inspector);
+	}
+
+	public void history(int start, int end, Changeset.Inspector inspector) {
 		if (!exists()) {
 			throw new IllegalStateException("Can't get history of invalid repository file node"); 
 		}
-		final int[] commitRevisions = new int[content.revisionCount()];
+		final int[] commitRevisions = new int[end - start + 1];
 		Revlog.Inspector insp = new Revlog.Inspector() {
 			int count = 0;
 			
@@ -53,14 +57,10 @@
 				commitRevisions[count++] = linkRevision;
 			}
 		};
-		content.iterate(0, -1, false, insp);
+		content.iterate(start, end, false, insp);
 		getRepo().getChangelog().range(inspector, commitRevisions);
 	}
 
-	public void history(int start, int end, Changeset.Inspector i) {
-		throw HgRepository.notImplemented();
-	}
-
 	/**
 	 * XXX perhaps, return value Nodeid[2] and boolean needNodeids is better (and higher level) API for this query?
 	 *