public void testPushToEmpty() throws Exception {
File srcRepoLoc = RepoUtils.cloneRepoToTempLocation("test-annotate", "test-push2empty-src", false);
File dstRepoLoc = RepoUtils.initEmptyTempRepo("test-push2empty-dst");
HgServer server = new HgServer().start(dstRepoLoc);
try {
final HgLookup hgLookup = new HgLookup();
HgRepository srcRepo = hgLookup.detect(srcRepoLoc);
HgPushCommand cmd = new HgPushCommand(srcRepo);
final HgRemoteRepository dstRemote = hgLookup.detect(server.getURL());
cmd.destination(dstRemote);
cmd.execute();
final HgRepository dstRepo = hgLookup.detect(dstRepoLoc);
checkRepositoriesAreSame(srcRepo, dstRepo);
final List<Nodeid> outgoing = new HgOutgoingCommand(srcRepo).against(dstRemote).executeLite();
errorCollector.assertTrue(outgoing.toString(), outgoing.isEmpty());
} finally {
server.stop();