Package org.tmatesoft.hg.core

Examples of org.tmatesoft.hg.core.HgIncomingCommand


    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);
  }
View Full Code Here


      final HgRepository dstRepo = hgLookup.detect(dstRepoLoc);
      HgPullCommand cmd = new HgPullCommand(dstRepo).source(srcRemote);
      cmd.execute();
      final HgRepository srcRepo = hgLookup.detect(srcRepoLoc);
      checkRepositoriesAreSame(srcRepo, dstRepo);
      final List<Nodeid> incoming = new HgIncomingCommand(dstRepo).against(srcRemote).executeLite();
      errorCollector.assertTrue(incoming.toString(), incoming.isEmpty());
      RepoUtils.assertHgVerifyOk(errorCollector, dstRepoLoc);
    } finally {
      server.stop();
    }
View Full Code Here

  }
 
  private List<Nodeid> runAndCompareIncoming(HgRepository localRepo, HgRemoteRepository hgRemote) throws Exception {
    // need new command instance as subsequence exec[Lite|Full] on the same command would yield same result,
    // regardless of the pull in between.
    HgIncomingCommand cmd = new HgIncomingCommand(localRepo);
    cmd.against(hgRemote);
    HgLogCommand.CollectHandler collector = new HgLogCommand.CollectHandler();
    LogOutputParser outParser = new LogOutputParser(true);
    ExecHelper eh = new ExecHelper(outParser, localRepo.getWorkingDir());
    cmd.executeFull(collector);
    eh.run("hg", "incoming", "--debug", hgRemote.getLocation());
    List<Nodeid> liteResult = cmd.executeLite();
    report(collector, outParser, liteResult, errorCollector);
    return liteResult;
  }
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.core.HgIncomingCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.