# HG changeset patch # User Artem Tikhomirov # Date 1361306109 -3600 # Node ID c1478cc31f451db16485db9201dc81a268e2c040 # Parent 83afa680555d5c0be6a36ee9a779e650fb5d246f Regression: expect file to be missing in a manifest diff -r 83afa680555d -r c1478cc31f45 src/org/tmatesoft/hg/repo/HgManifest.java --- a/src/org/tmatesoft/hg/repo/HgManifest.java Tue Feb 19 21:17:39 2013 +0100 +++ b/src/org/tmatesoft/hg/repo/HgManifest.java Tue Feb 19 21:35:09 2013 +0100 @@ -266,9 +266,9 @@ IntMap resMap = new IntMap(3); FileLookupInspector parser = new FileLookupInspector(encodingHelper, file, resMap, null); parser.walk(manifestRevIndex, content); - assert resMap.size() == 1; + assert resMap.size() <= 1; // size() == 0 if file wasn't found // can't use changelogRevisionIndex as key - it might have been TIP - return resMap.get(resMap.firstKey()); + return resMap.size() == 0 ? null : resMap.get(resMap.firstKey()); } /** @@ -310,9 +310,9 @@ IntMap resMap = new IntMap(2); FileLookupInspector parser = new FileLookupInspector(encodingHelper, file, null, resMap); parser.walk(manifestRevIdx, content); - assert resMap.size() == 1; + assert resMap.size() <= 1; // size() == 0 if not found // can't use changesetRevIndex as key - it might have been TIP - return resMap.get(resMap.firstKey()); + return resMap.size() == 0 ? null : resMap.get(resMap.firstKey()); }