Examples of HgRemoteRepository


Examples of org.tmatesoft.hg.repo.HgRemoteRepository

    if (!hgRepo.init(cmdLineOpts.findRepository())) {
      System.err.printf("Can't find repository in: %s\n", hgRepo.getRepository().getLocation());
      return;
    }
    // XXX perhaps, HgRepoFacade shall get detectRemote() analog (to get remote server with respect of facade's repo)
    HgRemoteRepository hgRemote = new HgLookup().detectRemote(cmdLineOpts.getSingle(""), hgRepo.getRepository());
    if (hgRemote.isInvalid()) {
      System.err.printf("Remote repository %s is not valid", hgRemote.getLocation());
      return;
    }
    HgPushCommand cmd = hgRepo.createPushCommand();
    cmd.destination(hgRemote);
    cmd.execute();
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgRemoteRepository

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

Examples of org.tmatesoft.hg.repo.HgRemoteRepository

    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;
    }
    HgPullCommand cmd = hgRepo.createPullCommand();
    cmd.source(hgRemote);
    cmd.execute();
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgRemoteRepository

    if (!hgRepo.init(cmdLineOpts.findRepository())) {
      System.err.printf("Can't find repository in: %s\n", hgRepo.getRepository().getLocation());
      return;
    }
    // XXX perhaps, HgRepoFacade shall get detectRemote() analog (to get remote server with respect of facade's repo)
    HgRemoteRepository hgRemote = new HgLookup().detectRemote(cmdLineOpts.getSingle(""), hgRepo.getRepository());
    if (hgRemote.isInvalid()) {
      System.err.printf("Remote repository %s is not valid", hgRemote.getLocation());
      return;
    }
    //
    HgOutgoingCommand cmd = hgRepo.createOutgoingCommand();
    cmd.against(hgRemote);
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgRemoteRepository

      System.err.println("Need at least one argument pointing to remote server to pull changes from");
      return;
    }
    HgCloneCommand cmd = new HgCloneCommand();
    String remoteRepo = noOptsArgs.get(0);
    HgRemoteRepository hgRemote = new HgLookup().detectRemote(remoteRepo, null);
    if (hgRemote.isInvalid()) {
      System.err.printf("Remote repository %s is not valid", hgRemote.getLocation());
      return;
    }
    cmd.source(hgRemote);
    if (noOptsArgs.size() > 1) {
      cmd.destination(new File(noOptsArgs.get(1)));
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgRemoteRepository

    File srcRepoLoc = RepoUtils.cloneRepoToTempLocation("test-annotate", "test-pull2empty-src", false);
    File dstRepoLoc = RepoUtils.initEmptyTempRepo("test-pull2empty-dst");
    HgServer server = new HgServer().start(srcRepoLoc);
    try {
      final HgLookup hgLookup = new HgLookup();
      final HgRemoteRepository srcRemote = hgLookup.detect(server.getURL());
      final HgRepository dstRepo = hgLookup.detect(dstRepoLoc);
      HgPullCommand cmd = new HgPullCommand(dstRepo).source(srcRemote);
      cmd.execute();
      final HgRepository srcRepo = hgLookup.detect(srcRepoLoc);
      checkRepositoriesAreSame(srcRepo, dstRepo);
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgRemoteRepository

    //
    // pull
    HgServer server = new HgServer().start(srcRepoLoc);
    final HgRepository dstRepo = hgLookup.detect(dstRepoLoc);
    try {
      final HgRemoteRepository srcRemote = hgLookup.detect(server.getURL());
      new HgPullCommand(dstRepo).source(srcRemote).execute();
    } finally {
      server.stop();
    }
    //
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgRemoteRepository

    assertEquals(HgPhase.Draft, phaseHelper.getPhase(dstRepo.getChangelog().getRevisionIndex(cmt2), cmt2));
    //

    HgServer server = new HgServer().publishing(true).start(srcRepoLoc);
    try {
      final HgRemoteRepository srcRemote = hgLookup.detect(server.getURL());
      new HgPullCommand(dstRepo).source(srcRemote).execute();
    } finally {
      server.stop();
    }
    // refresh PhasesHelper
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgRemoteRepository

    Nodeid r8 = srcRepo.getChangelog().getRevision(8);

    HgRepository dstRepo = hgLookup.detect(dstRepoLoc);
    HgServer server = new HgServer().publishing(false).start(srcRepoLoc);
    try {
      final HgRemoteRepository srcRemote = hgLookup.detect(server.getURL());
      new HgPullCommand(dstRepo).source(srcRemote).execute();
    } finally {
      server.stop();
    }
    PhasesHelper phaseHelper = new PhasesHelper(HgInternals.getImplementationRepo(dstRepo));
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgRemoteRepository

    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();
      assertEquals("[sanity]", "no-merge", srcRepo.getWorkingCopyBranchName());
      RepoUtils.modifyFileAppend(f1, "change2");
      new HgCommitCommand(srcRepo).message("Commit 2").execute();
      //
      HgOutgoingCommand cmd = new HgOutgoingCommand(srcRepo).against(dstRemote);
      LogOutputParser outParser = new LogOutputParser(true);
      ExecHelper eh = new ExecHelper(outParser, srcRepoLoc);
      HgLogCommand.CollectHandler collector = new HgLogCommand.CollectHandler();
      //
      List<Nodeid> liteResult = cmd.executeLite();
      cmd.executeFull(collector);
      eh.run("hg", "outgoing", "--debug", dstRemote.getLocation());
      TestIncoming.report(collector, outParser, liteResult, errorCollector);
    } finally {
      server.stop();
    }
  }
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.