final HgChangelog clog = repo.getChangelog();
final HgParentChildMap<HgChangelog> parentHelper = new HgParentChildMap<HgChangelog>(clog);
parentHelper.init();
final Internals implRepo = HgInternals.getImplementationRepo(repo);
final PhasesHelper phaseHelper = new PhasesHelper(implRepo, parentHelper);
final RepositoryComparator comparator = new RepositoryComparator(parentHelper, remoteRepo);
comparator.compare(new ProgressSupport.Sub(progress, 50), getCancelSupport(null, true));
List<Nodeid> l = comparator.getLocalOnlyRevisions();
if (phaseHelper.isCapableOfPhases() && phaseHelper.withSecretRoots()) {
RevisionSet secret = phaseHelper.allSecret();
outgoing = new RevisionSet(l).subtract(secret);
} else {
outgoing = new RevisionSet(l);
}
HgBundle b = null;
if (!outgoing.isEmpty()) {
//
// prepare bundle
BundleGenerator bg = new BundleGenerator(implRepo);
File bundleFile = bg.create(outgoing.asList());
progress.worked(20);
b = new HgLookup(repo.getSessionContext()).loadBundle(bundleFile);
//
// send changes
remoteRepo.unbundle(b, comparator.getRemoteHeads());
} // update phase information nevertheless
progress.worked(20);
//
// update phase information
if (phaseHelper.isCapableOfPhases()) {