stream = new HgInputStream(new ByteArrayInputStream(bos.toByteArray()), repo.newDecoder());
if (stream.find(BEGIN)) {
result = Lists.newArrayList();
while (!stream.isEof() && !stream.match(BEGIN_FALLBACK)) {
result.add(repo.changeset(stream.textUpTo('\n')));
}
} else {
stream = new HgInputStream(new ByteArrayInputStream(bos.toByteArray()), repo.newDecoder());
List<String> nodePrefixes = Lists.newArrayList();