Mercurial > jhg
diff src/org/tmatesoft/hg/repo/HgDataFile.java @ 300:650b45d290b1
Share range check code
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Sat, 17 Sep 2011 13:41:04 +0200 |
parents | 981f9f50bb6c |
children | ae8d116f4ee2 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgDataFile.java Sat Sep 17 13:26:52 2011 +0200 +++ b/src/org/tmatesoft/hg/repo/HgDataFile.java Sat Sep 17 13:41:04 2011 +0200 @@ -234,14 +234,14 @@ throw new IllegalStateException("Can't get history of invalid repository file node"); } final int last = getLastRevision(); - if (start < 0 || start > last) { - throw new IllegalArgumentException(); - } if (end == TIP) { end = last; - } else if (end < start || end > last) { - throw new IllegalArgumentException(); } + if (start == TIP) { + start = last; + } + HgInternals.checkRevlogRange(start, end, last); + final int[] commitRevisions = new int[end - start + 1]; final boolean[] needsSorting = { false }; RevlogStream.Inspector insp = new RevlogStream.Inspector() {