Mercurial > jhg
diff src/org/tmatesoft/hg/repo/HgDataFile.java @ 135:3959bffb14e9
explicit op name instead math op to get last rev number
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Wed, 16 Feb 2011 22:00:39 +0100 |
parents | afac8ddc5dd2 |
children | 1a7a9a20e1f9 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgDataFile.java Wed Feb 16 21:51:32 2011 +0100 +++ b/src/org/tmatesoft/hg/repo/HgDataFile.java Wed Feb 16 22:00:39 2011 +0100 @@ -97,7 +97,7 @@ @Override public byte[] content(int revision) { if (revision == TIP) { - revision = content.revisionCount() - 1; // FIXME maxRevision. + revision = getLastRevision(); } byte[] data = super.content(revision); if (metadata == null) { @@ -154,14 +154,14 @@ } public void history(HgChangelog.Inspector inspector) { - history(0, content.revisionCount() - 1, inspector); + history(0, getLastRevision(), inspector); } public void history(int start, int end, HgChangelog.Inspector inspector) { if (!exists()) { throw new IllegalStateException("Can't get history of invalid repository file node"); } - final int last = content.revisionCount() - 1; + final int last = getLastRevision(); if (start < 0 || start > last) { throw new IllegalArgumentException(); }