diff src/com/tmate/hgkit/ll/HgDataFile.java @ 22:603806cd2dc6

Status of local working dir against non-tip base revision
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 06 Jan 2011 03:30:20 +0100
parents e929cecae4e1
children e45e75e22523
line wrap: on
line diff
--- a/src/com/tmate/hgkit/ll/HgDataFile.java	Wed Jan 05 04:10:28 2011 +0100
+++ b/src/com/tmate/hgkit/ll/HgDataFile.java	Thu Jan 06 03:30:20 2011 +0100
@@ -32,10 +32,23 @@
 		return path; // hgRepo.backresolve(this) -> name?
 	}
 
+	public int length(Nodeid nodeid) {
+		int revision = content.findLocalRevisionNumber(nodeid);
+		return content.dataLength(revision);
+	}
+
 	public byte[] content() {
 		return content(TIP);
 	}
+
+	public byte[] content(Nodeid nodeid) {
+		int revision = content.findLocalRevisionNumber(nodeid);
+		return content(revision);
+	}
 	
+	/**
+	 * @param revision - repo-local index of this file change (not a changelog revision number!)
+	 */
 	public byte[] content(int revision) {
 		final byte[][] dataPtr = new byte[1][];
 		Revlog.Inspector insp = new Revlog.Inspector() {