if (Boolean.FALSE.booleanValue()) {
new SequenceConstructor().test();
return;
}
Options cmdLineOpts = Options.parse(args, Collections.<String>emptySet());
HgRepoFacade hgRepo = new HgRepoFacade();
if (!hgRepo.init(cmdLineOpts.findRepository())) {
System.err.printf("Can't find repository in: %s\n", hgRepo.getRepository().getLocation());
return;
}
HgRemoteRepository hgRemote = new HgLookup().detectRemote(cmdLineOpts.getSingle(""), hgRepo.getRepository());
if (hgRemote.isInvalid()) {
System.err.printf("Remote repository %s is not valid", hgRemote.getLocation());
return;
}
HgIncomingCommand cmd = hgRepo.createIncomingCommand();
cmd.against(hgRemote);
//
List<Nodeid> missing = cmd.executeLite();
Collections.reverse(missing); // useful to test output, from newer to older
Outgoing.dump("Nodes to fetch:", missing);
System.out.printf("Total: %d\n\n", missing.size());
//
// Complete
final ChangesetDumpHandler h = new ChangesetDumpHandler(hgRepo.getRepository());
h.complete(false); // this option looks up index of parent revision, done via repo.changelog (which doesn't have any of these new revisions)
// this can be fixed by tracking all nodeid->revision idx inside ChangesetDumpHandler, and refer to repo.changelog only when that mapping didn't work
h.verbose(cmdLineOpts.getBoolean("-v", "--verbose"));
cmd.executeFull(h);
}