Mercurial > hg4j
diff 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 |
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/internal/RevlogStream.java Thu Apr 21 19:16:45 2011 +0200 +++ b/src/org/tmatesoft/hg/internal/RevlogStream.java Tue Apr 26 02:50:06 2011 +0200 @@ -319,6 +319,11 @@ ArrayList<Integer> resOffsets = new ArrayList<Integer>(); DataAccess da = getIndexStream(); try { + if (da.isEmpty()) { + // do not fail with exception if stream is empty, it's likely intentional + baseRevisions = new int[0]; + return; + } int versionField = da.readInt(); da.readInt(); // just to skip next 4 bytes of offset + flags final int INLINEDATA = 1 << 16;