Mercurial > jhg
diff src/com/tmate/hgkit/ll/Revlog.java @ 39:4e9b66b07a28
Check changelog group starts with proper (known) base
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 14 Jan 2011 01:07:05 +0100 |
parents | e45e75e22523 |
children | 26e3eeaa3962 |
line wrap: on
line diff
--- a/src/com/tmate/hgkit/ll/Revlog.java Fri Jan 14 00:52:19 2011 +0100 +++ b/src/com/tmate/hgkit/ll/Revlog.java Fri Jan 14 01:07:05 2011 +0100 @@ -35,6 +35,16 @@ return content.revisionCount(); } + // Till now, i follow approach that NULL nodeid is never part of revlog + public boolean isKnown(Nodeid nodeid) { + try { + int revision = content.findLocalRevisionNumber(nodeid); + return revision >= 0 && revision < getRevisionCount(); + } catch (IllegalArgumentException ex) { + // FIXME bad way to figure out if nodeid is from this revlog + return false; + } + } /** * Access to revision data as is (decompressed, but otherwise unprocessed, i.e. not parsed for e.g. changeset or manifest entries) * @param nodeid