diff src/org/tmatesoft/hg/internal/RevlogStream.java @ 585:b47ef0d2777b

Access to base revision filed comes handy for debug sometimes
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 25 Apr 2013 17:53:44 +0200
parents ed243b668502
children 9619301a7bb9
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/RevlogStream.java	Thu Apr 25 16:08:17 2013 +0200
+++ b/src/org/tmatesoft/hg/internal/RevlogStream.java	Thu Apr 25 17:53:44 2013 +0200
@@ -192,6 +192,18 @@
 		}
 	}
 	
+	/**
+	 * Extract base revision field from the revlog
+	 * 
+	 * @throws HgInvalidControlFileException if attempt to read index file failed
+	 * @throws HgInvalidRevisionException if revisionIndex argument doesn't represent a valid record in the revlog
+	 */
+	public int baseRevision(int revisionIndex) throws HgInvalidControlFileException, HgInvalidRevisionException {
+		initOutline();
+		revisionIndex = checkRevisionIndex(revisionIndex);
+		return getBaseRevision(revisionIndex);
+	}
+	
 	// Perhaps, RevlogStream should be limited to use of plain int revisions for access,
 	// while Nodeids should be kept on the level up, in Revlog. Guess, Revlog better keep
 	// map of nodeids, and once this comes true, we may get rid of this method.