Examples of detect()


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());
      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());
      RepoUtils.modifyFileAppend(f1, "change2");
View Full Code Here

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

      assertEquals("[sanity]", "no-merge", srcRepo.getWorkingCopyBranchName());
      RepoUtils.modifyFileAppend(f1, "change2");
      new HgCommitCommand(srcRepo).message("Commit 2").execute();
      //
      new HgPushCommand(srcRepo).destination(dstRemote).execute();
      checkRepositoriesAreSame(srcRepo, hgLookup.detect(dstRepoLoc));
      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, "hello.c");
    assertTrue("[sanity]", f1.canWrite());
    HgServer server = new HgServer().publishing(false).start(dstRepoLoc);
    try {
      final HgLookup hgLookup = new HgLookup();
      final HgRepository srcRepo = hgLookup.detect(srcRepoLoc);
      final HgRemoteRepository dstRemote = hgLookup.detect(server.getURL());
      PhasesHelper phaseHelper = new PhasesHelper(HgInternals.getImplementationRepo(srcRepo));
      final RevisionSet allDraft = phaseHelper.allDraft();
      assertFalse("[sanity]", allDraft.isEmpty());
      final int publicCsetToBranchAt = 4;
View Full Code Here

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

    assertTrue("[sanity]", f1.canWrite());
    HgServer server = new HgServer().publishing(false).start(dstRepoLoc);
    try {
      final HgLookup hgLookup = new HgLookup();
      final HgRepository srcRepo = hgLookup.detect(srcRepoLoc);
      final HgRemoteRepository dstRemote = hgLookup.detect(server.getURL());
      PhasesHelper phaseHelper = new PhasesHelper(HgInternals.getImplementationRepo(srcRepo));
      final RevisionSet allDraft = phaseHelper.allDraft();
      assertFalse("[sanity]", allDraft.isEmpty());
      final int publicCsetToBranchAt = 4;
      assertEquals("[sanity]", HgPhase.Public, phaseHelper.getPhase(publicCsetToBranchAt, null));
View Full Code Here

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

      final HgCommitCommand commitCmd = new HgCommitCommand(srcRepo).message("Commit aaa");
      assertTrue(commitCmd.execute().isOk());
      Nodeid newCommit = commitCmd.getCommittedRevision();
      //
      new HgPushCommand(srcRepo).destination(dstRemote).execute();
      HgRepository dstRepo = hgLookup.detect(dstRepoLoc);
      final HgChangelog srcClog = srcRepo.getChangelog();
      final HgChangelog dstClog = dstRepo.getChangelog();
      // refresh PhasesHelper
      phaseHelper = new PhasesHelper(HgInternals.getImplementationRepo(srcRepo));
      // check if phase didn't change
View Full Code Here

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

    File srcRepoLoc = RepoUtils.copyRepoToTempLocation("test-phases", "test-push-phase-update-1-src");
    File dstRepoLoc = RepoUtils.copyRepoToTempLocation("test-phases", "test-push-phase-update-1-dst");
    File f1 = new File(srcRepoLoc, "hello.c");
    assertTrue("[sanity]", f1.canWrite());
    final HgLookup hgLookup = new HgLookup();
    final HgRepository srcRepo = hgLookup.detect(srcRepoLoc);
    final ExecHelper dstRun = new ExecHelper(new OutputParser.Stub(), dstRepoLoc);
    final int publicCsetToBranchAt = 4;
    final int r5 = 5, r6 = 6, r8 = 8;
    PhasesHelper srcPhase = new PhasesHelper(HgInternals.getImplementationRepo(srcRepo));
    assertEquals("[sanity]", HgPhase.Draft, srcPhase.getPhase(r5, null));
View Full Code Here

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

    assertEquals(0, dstRun.getExitValue());
    dstRun.exec("hg", "phase", "--secret", "--force", String.valueOf(r8));
    assertEquals(0, dstRun.getExitValue());
    HgServer server = new HgServer().publishing(false).start(dstRepoLoc);
    try {
      final HgRemoteRepository dstRemote = hgLookup.detect(server.getURL());
      // commit new draft head
      new HgCheckoutCommand(srcRepo).changeset(publicCsetToBranchAt).clean(true).execute();
      RepoUtils.modifyFileAppend(f1, "// aaa");
      final HgCommitCommand commitCmd = new HgCommitCommand(srcRepo).message("Commit aaa");
      assertTrue(commitCmd.execute().isOk());
View Full Code Here

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

      errorCollector.assertEquals(HgPhase.Public, srcPhase.getPhase(r5, null));
      errorCollector.assertEquals(HgPhase.Draft, srcPhase.getPhase(r6, null));
      // r8 is secret on server, locally can't make it less exposed though
      errorCollector.assertEquals(HgPhase.Draft, srcPhase.getPhase(r8, null));
      //
      HgRepository dstRepo = hgLookup.detect(dstRepoLoc);
      final HgChangelog dstClog = dstRepo.getChangelog();
      assertTrue(dstClog.isKnown(newCommit));
      PhasesHelper dstPhase = new PhasesHelper(HgInternals.getImplementationRepo(dstRepo));
      errorCollector.assertEquals(HgPhase.Draft, dstPhase.getPhase(dstClog.getRevisionIndex(newCommit), newCommit));
      // the one that was secret is draft now
View Full Code Here

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

    File dstRepoLoc = RepoUtils.initEmptyTempRepo("test-push-phase-update-1-dst");
    final int r4 = 4, r5 = 5, r6 = 6, r9 = 9;
    HgServer server = new HgServer().publishing(false).start(dstRepoLoc);
    try {
      final HgLookup hgLookup = new HgLookup();
      final HgRepository srcRepo = hgLookup.detect(srcRepoLoc);
      final HgRemoteRepository dstRemote = hgLookup.detect(server.getURL());
      new HgPushCommand(srcRepo).destination(dstRemote).execute();
      //
      // make sure pushed repository got same draft root
      final Nodeid r4PublicHead = srcRepo.getChangelog().getRevision(r4);
View Full Code Here

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

    final int r4 = 4, r5 = 5, r6 = 6, r9 = 9;
    HgServer server = new HgServer().publishing(false).start(dstRepoLoc);
    try {
      final HgLookup hgLookup = new HgLookup();
      final HgRepository srcRepo = hgLookup.detect(srcRepoLoc);
      final HgRemoteRepository dstRemote = hgLookup.detect(server.getURL());
      new HgPushCommand(srcRepo).destination(dstRemote).execute();
      //
      // make sure pushed repository got same draft root
      final Nodeid r4PublicHead = srcRepo.getChangelog().getRevision(r4);
      final Nodeid r5DraftRoot = srcRepo.getChangelog().getRevision(r5);
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.