Examples of HgCloneCommand


Examples of org.tmatesoft.hg.core.HgCloneCommand

    List<String> noOptsArgs = cmdLineOpts.getList("");
    if (noOptsArgs.isEmpty()) {
      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)));
    } else {
      cmd.destination(new File(System.getProperty("user.dir")));
    }
    cmd.execute();
  }
View Full Code Here

Examples of org.tmatesoft.hg.core.HgCloneCommand

  @Test
  public void testSimpleClone() throws Exception {
    int x = 0;
    final File tempDir = Configuration.get().getTempDir();
    for (HgRemoteRepository hgRemote : Configuration.get().allRemote()) {
      HgCloneCommand cmd = new HgCloneCommand();
      cmd.source(hgRemote);
      File dest = new File(tempDir, "test-clone-" + x++);
      if (dest.exists()) {
        RepoUtils.rmdir(dest);
      }
      cmd.destination(dest);
      cmd.execute();
      verify(hgRemote, dest);
    }
  }
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.