Examples of detect()


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

    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);
      final List<Nodeid> incoming = new HgIncomingCommand(dstRepo).against(srcRemote).executeLite();
View Full Code Here

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

      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);
      final List<Nodeid> incoming = new HgIncomingCommand(dstRepo).against(srcRemote).executeLite();
      errorCollector.assertTrue(incoming.toString(), incoming.isEmpty());
      RepoUtils.assertHgVerifyOk(errorCollector, dstRepoLoc);
    } finally {
View Full Code Here

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

    File f1 = new File(srcRepoLoc, "file1");
    assertTrue("[sanity]", f1.canWrite());
    final HgLookup hgLookup = new HgLookup();
    // add two commits, one with new file at different branch
    // commit 1
    final HgRepository srcRepo = hgLookup.detect(srcRepoLoc);
    assertEquals("[sanity]", "default", srcRepo.getWorkingCopyBranchName());
    RepoUtils.modifyFileAppend(f1, "change1");
    HgCommitCommand commitCmd = new HgCommitCommand(srcRepo).message("Commit 1");
    assertTrue(commitCmd.execute().isOk());
    final Nodeid cmt1 = commitCmd.getCommittedRevision();
View Full Code Here

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

    assertTrue(commitCmd.execute().isOk());
    final Nodeid cmt2 = commitCmd.getCommittedRevision();
    //
    // 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.HgLookup.detect()

    //
    // 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.HgLookup.detect()

    File srcRepoLoc = RepoUtils.copyRepoToTempLocation("test-phases", "test-pull-pub-src");
    File dstRepoLoc = RepoUtils.copyRepoToTempLocation("test-phases", "test-pull-pub-dst");
    File f1 = new File(dstRepoLoc, "hello.c");
    assertTrue("[sanity]", f1.canWrite());
    final HgLookup hgLookup = new HgLookup();
    HgRepository dstRepo = hgLookup.detect(dstRepoLoc);
    PhasesHelper phaseHelper = new PhasesHelper(HgInternals.getImplementationRepo(dstRepo));
    //
    // new child revision for shared public parent
    assertEquals(HgPhase.Public, phaseHelper.getPhase(4, null));
    new HgCheckoutCommand(dstRepo).changeset(4).clean(true).execute();
View Full Code Here

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

    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.HgLookup.detect()

    // copy, not clone as latter updates phase information
    File srcRepoLoc = RepoUtils.copyRepoToTempLocation("test-phases", "test-pull-nopub-src");
    File dstRepoLoc = RepoUtils.initEmptyTempRepo("test-pull-nopub-dst");
    Map<String,?> props = Collections.singletonMap(Internals.CFG_PROPERTY_CREATE_PHASEROOTS, true);
    final HgLookup hgLookup = new HgLookup(new BasicSessionContext(props, null));
    HgRepository srcRepo = hgLookup.detect(srcRepoLoc);   
    // revisions 6 and 9 are secret, so
    // index of revisions 4 and 5 won't change, but that of 7 and 8 would
    Nodeid r7 = srcRepo.getChangelog().getRevision(7);
    Nodeid r8 = srcRepo.getChangelog().getRevision(8);
View Full Code Here

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

    // revisions 6 and 9 are secret, so
    // index of revisions 4 and 5 won't change, but that of 7 and 8 would
    Nodeid r7 = srcRepo.getChangelog().getRevision(7);
    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 {
View Full Code Here

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

    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
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.