/**
* @return never <code>null</code>. empty file if no changesets were written
*/
public File create(List<Nodeid> changesets) throws HgIOException, IOException {
final HgChangelog clog = repo.getRepo().getChangelog();
final HgManifest manifest = repo.getRepo().getManifest();
IntVector clogRevsVector = new IntVector(changesets.size(), 0);
for (Nodeid n : changesets) {
clogRevsVector.add(clog.getRevisionIndex(n));
}
clogRevsVector.sort(true);
final int[] clogRevs = clogRevsVector.toArray();
final IntMap<Nodeid> clogMap = new IntMap<Nodeid>(changesets.size());
final IntVector manifestRevs = new IntVector(changesets.size(), 0);
final List<HgDataFile> files = new ArrayList<HgDataFile>();
clog.range(new HgChangelog.Inspector() {
private Set<String> seenFiles = new HashSet<String>();
public void next(int revisionIndex, Nodeid nodeid, RawChangeset cset) throws HgRuntimeException {
clogMap.put(revisionIndex, nodeid);
manifestRevs.add(manifest.getRevisionIndex(cset.manifest()));
for (String f : cset.files()) {
if (seenFiles.contains(f)) {
continue;
}
seenFiles.add(f);