//
// apparently, key value can't end with '/', `hg commit` fails if it does:
// abort: path ends in directory separator: fourth/
Path p = pathFactory.path(key.charAt(key.length()-1) == '/' ? key : key + '/');
String revValue = substate.get(key);
HgSubrepoLocation loc = hgRepoInternal.newSubrepo(p, value, kind, revValue == null ? null : Nodeid.fromAscii(revValue));
res.add(loc);
}
return Arrays.asList(res.toArray(new HgSubrepoLocation[res.size()]));
} finally {
br.close();