comparison src/org/tmatesoft/hg/internal/RevlogStream.java @ 202:706bcc7cfee4

Basic test for HgIncomingCommand. Fix RepositoryComparator for cases when whole repository is unknown. Respect freshly initialized (empty) repositories in general.
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 26 Apr 2011 02:50:06 +0200
parents 33a7d76f067b
children e39cf474ef94
comparison
equal deleted inserted replaced
201:a736f42ed75b 202:706bcc7cfee4
317 } 317 }
318 ArrayList<Integer> resBases = new ArrayList<Integer>(); 318 ArrayList<Integer> resBases = new ArrayList<Integer>();
319 ArrayList<Integer> resOffsets = new ArrayList<Integer>(); 319 ArrayList<Integer> resOffsets = new ArrayList<Integer>();
320 DataAccess da = getIndexStream(); 320 DataAccess da = getIndexStream();
321 try { 321 try {
322 if (da.isEmpty()) {
323 // do not fail with exception if stream is empty, it's likely intentional
324 baseRevisions = new int[0];
325 return;
326 }
322 int versionField = da.readInt(); 327 int versionField = da.readInt();
323 da.readInt(); // just to skip next 4 bytes of offset + flags 328 da.readInt(); // just to skip next 4 bytes of offset + flags
324 final int INLINEDATA = 1 << 16; 329 final int INLINEDATA = 1 << 16;
325 inline = (versionField & INLINEDATA) != 0; 330 inline = (versionField & INLINEDATA) != 0;
326 long offset = 0; // first offset is always 0, thus Hg uses it for other purposes 331 long offset = 0; // first offset is always 0, thus Hg uses it for other purposes