comparison 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
comparison
equal deleted inserted replaced
299:45dc79e545f5 300:650b45d290b1
232 public void history(int start, int end, HgChangelog.Inspector inspector) { 232 public void history(int start, int end, HgChangelog.Inspector inspector) {
233 if (!exists()) { 233 if (!exists()) {
234 throw new IllegalStateException("Can't get history of invalid repository file node"); 234 throw new IllegalStateException("Can't get history of invalid repository file node");
235 } 235 }
236 final int last = getLastRevision(); 236 final int last = getLastRevision();
237 if (start < 0 || start > last) {
238 throw new IllegalArgumentException();
239 }
240 if (end == TIP) { 237 if (end == TIP) {
241 end = last; 238 end = last;
242 } else if (end < start || end > last) { 239 }
243 throw new IllegalArgumentException(); 240 if (start == TIP) {
244 } 241 start = last;
242 }
243 HgInternals.checkRevlogRange(start, end, last);
244
245 final int[] commitRevisions = new int[end - start + 1]; 245 final int[] commitRevisions = new int[end - start + 1];
246 final boolean[] needsSorting = { false }; 246 final boolean[] needsSorting = { false };
247 RevlogStream.Inspector insp = new RevlogStream.Inspector() { 247 RevlogStream.Inspector insp = new RevlogStream.Inspector() {
248 int count = 0; 248 int count = 0;
249 public void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[] nodeid, DataAccess data) { 249 public void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[] nodeid, DataAccess data) {