Internals implRepo = Internals.getInstance(repo);
final DirstateBuilder dirstateBuilder = new DirstateBuilder(implRepo);
dirstateBuilder.fillFrom(new DirstateReader(implRepo, new Path.SimpleSource(repo.getSessionContext().getPathFactory(), cacheFiles)));
final HgChangelog clog = repo.getChangelog();
final Nodeid headCset1 = clog.getRevision(firstCset);
dirstateBuilder.parents(headCset1, clog.getRevision(secondCset));
//
MergeStateBuilder mergeStateBuilder = new MergeStateBuilder(implRepo);
mergeStateBuilder.prepare(headCset1);
ManifestRevision m1, m2, ma;