Mercurial > hg4j
changeset 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 | 73c20c648c1f |
files | build.xml src/org/tmatesoft/hg/internal/RevlogStream.java |
diffstat | 2 files changed, 13 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ <target name="build-lib"> <mkdir dir="bin" /> - <javac srcdir="src" destdir="bin" debug="${compile-with-debug}" /> + <javac srcdir="src" destdir="bin" debug="${compile-with-debug}" includeantruntime="no"/> <jar destfile="${hg4j.jar}"> <fileset dir="bin/"> <include name="org/tmatesoft/hg/core/**" />
--- 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.