# HG changeset patch # User Artem Tikhomirov # Date 1366905224 -7200 # Node ID b47ef0d2777bfd406dabb668f555fc1d32afd142 # Parent ed243b6685026a54e7fc8214dd6a369b6b8dc7e6 Access to base revision filed comes handy for debug sometimes diff -r ed243b668502 -r b47ef0d2777b build.xml --- a/build.xml Thu Apr 25 16:08:17 2013 +0200 +++ b/build.xml Thu Apr 25 17:53:44 2013 +0200 @@ -134,7 +134,7 @@ - + diff -r ed243b668502 -r b47ef0d2777b src/org/tmatesoft/hg/internal/RevlogStream.java --- 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.