Examples of detect()


Examples of org.tmatesoft.hg.repo.HgLookup.detect()

  public void testSimple() throws Exception {
    int x = 0;
    HgLookup lookup = new HgLookup();
    for (HgRemoteRepository hgRemote : Configuration.get().allRemote()) {
      File dest = RepoUtils.initEmptyTempRepo("test-incoming-" + x++);
      HgRepository localRepo = lookup.detect(dest);
      // Idea:
      // hg in, hg4j in, compare
      // hg pull total/2
      // hg in, hg4j in, compare
      List<Nodeid> incoming = runAndCompareIncoming(localRepo, hgRemote);
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgLookup.detect()

      Nodeid median = incoming.get(incoming.size() / 2);
      System.out.println("About to pull up to revision " + median.shortNotation());
      new ExecHelper(new OutputParser.Stub(), dest).run("hg", "pull", "-r", median.toString(), hgRemote.getLocation());
      //
      // shall re-read repository to pull up new changes
      localRepo = lookup.detect(dest);
      runAndCompareIncoming(localRepo, hgRemote);
    }
  }
 
  private List<Nodeid> runAndCompareIncoming(HgRepository localRepo, HgRemoteRepository hgRemote) throws Exception {
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgLookup.detect()

      File dest = RepoUtils.createEmptyDir("test-outgoing-" + x++);
      ExecHelper eh0 = new ExecHelper(new OutputParser.Stub(false), null);
      eh0.run("hg", "clone", hgRemote.getLocation(), dest.toString());
      eh0.cwd(dest);
      Assert.assertEquals("initial clone failed", 0, eh0.getExitValue());
      HgOutgoingCommand cmd = new HgOutgoingCommand(lookup.detect(dest)).against(hgRemote);
      LogOutputParser outParser = new LogOutputParser(true);
      ExecHelper eh = new ExecHelper(outParser, dest);
      HgLogCommand.CollectHandler collector = new HgLogCommand.CollectHandler();
      //
      cmd.executeFull(collector);
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgLookup.detect()

      eh0.run("hg", "add");
      eh0.run("hg", "commit", "-m", "1");
      RepoUtils.modifyFileAppend(f, "2");
      eh0.run("hg", "commit", "-m", "2");
      //
      cmd = new HgOutgoingCommand(lookup.detect(dest)).against(hgRemote);
      cmd.executeFull(collector = new HgLogCommand.CollectHandler());
      liteResult = cmd.executeLite();
      outParser.reset();
      eh.run("hg", "outgoing", "--debug", hgRemote.getLocation());
      TestIncoming.report(collector, outParser, liteResult, errorCollector);
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgLookup.detect()

    File f1 = new File(srcRepoLoc, "file1");
    assertTrue("[sanity]", f1.canWrite());
    HgServer server = new HgServer().start(dstRepoLoc);
    try {
      final HgLookup hgLookup = new HgLookup();
      final HgRepository srcRepo = hgLookup.detect(srcRepoLoc);
      final HgRemoteRepository dstRemote = hgLookup.detect(server.getURL());
      new HgCheckoutCommand(srcRepo).changeset(6).clean(true).execute();
      assertEquals("[sanity]", "with-merge", srcRepo.getWorkingCopyBranchName());
      RepoUtils.modifyFileAppend(f1, "change1");
      new HgCommitCommand(srcRepo).message("Commit 1").execute();
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgLookup.detect()

    assertTrue("[sanity]", f1.canWrite());
    HgServer server = new HgServer().start(dstRepoLoc);
    try {
      final HgLookup hgLookup = new HgLookup();
      final HgRepository srcRepo = hgLookup.detect(srcRepoLoc);
      final HgRemoteRepository dstRemote = hgLookup.detect(server.getURL());
      new HgCheckoutCommand(srcRepo).changeset(6).clean(true).execute();
      assertEquals("[sanity]", "with-merge", srcRepo.getWorkingCopyBranchName());
      RepoUtils.modifyFileAppend(f1, "change1");
      new HgCommitCommand(srcRepo).message("Commit 1").execute();
      new HgCheckoutCommand(srcRepo).changeset(5).clean(true).execute();
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgLookup.detect()

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

Examples of org.tmatesoft.hg.repo.HgLookup.detect()

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

Examples of org.tmatesoft.hg.repo.HgLookup.detect()

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

Examples of org.tmatesoft.hg.repo.HgLookup.detect()

    File f1 = new File(srcRepoLoc, "file1");
    assertTrue("[sanity]", f1.canWrite());
    HgServer server = new HgServer().start(dstRepoLoc);
    try {
      final HgLookup hgLookup = new HgLookup();
      final HgRepository srcRepo = hgLookup.detect(srcRepoLoc);
      final HgRemoteRepository dstRemote = hgLookup.detect(server.getURL());
      RepoUtils.modifyFileAppend(f1, "change1");
      new HgCommitCommand(srcRepo).message("Commit 1").execute();
      new HgCheckoutCommand(srcRepo).changeset(7).clean(true).execute();
      assertEquals("[sanity]", "no-merge", srcRepo.getWorkingCopyBranchName());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.