Examples of detect()


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

      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);
      HgRepository dstRepo = hgLookup.detect(dstRepoLoc);
      final HgChangelog dstClog = dstRepo.getChangelog();
      PhasesHelper dstPhase = new PhasesHelper(HgInternals.getImplementationRepo(dstRepo));
      assertEquals(HgPhase.Public, dstPhase.getPhase(dstClog.getRevisionIndex(r4PublicHead), r4PublicHead));
      assertEquals(HgPhase.Draft, dstPhase.getPhase(dstClog.getRevisionIndex(r5DraftRoot), r5DraftRoot));
      //
View Full Code Here

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

    File srcRepoLoc = RepoUtils.copyRepoToTempLocation("test-phases", "test-push-pub-src");
    File dstRepoLoc = RepoUtils.initEmptyTempRepo("test-push-pub-dst");
    HgServer server = new HgServer().publishing(true).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());
      // push all changes
View Full Code Here

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

    File dstRepoLoc = RepoUtils.initEmptyTempRepo("test-push-pub-dst");
    HgServer server = new HgServer().publishing(true).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());
      // push all changes
      new HgPushCommand(srcRepo).destination(dstRemote).execute();
View Full Code Here

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

      PhasesHelper phaseHelper = new PhasesHelper(HgInternals.getImplementationRepo(srcRepo));
      final RevisionSet allDraft = phaseHelper.allDraft();
      assertFalse("[sanity]", allDraft.isEmpty());
      // push all changes
      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));
      for (Nodeid n : allDraft) {
View Full Code Here

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

    File srcRepoLoc = RepoUtils.copyRepoToTempLocation("test-phases", "test-push-no-secret-src");
    File dstRepoLoc = RepoUtils.initEmptyTempRepo("test-push-no-secret-dst");
    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());
      PhasesHelper phaseHelper = new PhasesHelper(HgInternals.getImplementationRepo(srcRepo));
      final RevisionSet allSecret = phaseHelper.allSecret();
      assertFalse("[sanity]", allSecret.isEmpty());
      new HgPushCommand(srcRepo).destination(dstRemote).execute();
View Full Code Here

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

    File dstRepoLoc = RepoUtils.initEmptyTempRepo("test-push-no-secret-dst");
    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());
      PhasesHelper phaseHelper = new PhasesHelper(HgInternals.getImplementationRepo(srcRepo));
      final RevisionSet allSecret = phaseHelper.allSecret();
      assertFalse("[sanity]", allSecret.isEmpty());
      new HgPushCommand(srcRepo).destination(dstRemote).execute();
      HgRepository dstRepo = hgLookup.detect(dstRepoLoc);
View Full Code Here

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

      final HgRemoteRepository dstRemote = hgLookup.detect(server.getURL());
      PhasesHelper phaseHelper = new PhasesHelper(HgInternals.getImplementationRepo(srcRepo));
      final RevisionSet allSecret = phaseHelper.allSecret();
      assertFalse("[sanity]", allSecret.isEmpty());
      new HgPushCommand(srcRepo).destination(dstRemote).execute();
      HgRepository dstRepo = hgLookup.detect(dstRepoLoc);
      final HgChangelog srcClog = srcRepo.getChangelog();
      final HgChangelog dstClog = dstRepo.getChangelog();
      errorCollector.assertEquals(srcClog.getRevisionCount() - allSecret.size(), dstClog.getRevisionCount());
      for (Nodeid n : allSecret) {   
        errorCollector.assertTrue(n.toString(), !dstClog.isKnown(n));
View Full Code Here

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

    srcRun.exec("hg", "bookmark", "-r", String.valueOf(bm_4_5), bm5);
    //
    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");
      final HgCommitCommand commitCmd = new HgCommitCommand(srcRepo).message("Commit 1");
      assertTrue(commitCmd.execute().isOk());
      assertEquals(bm1, srcRepo.getBookmarks().getActiveBookmarkName());
View Full Code Here

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

    //
    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");
      final HgCommitCommand commitCmd = new HgCommitCommand(srcRepo).message("Commit 1");
      assertTrue(commitCmd.execute().isOk());
      assertEquals(bm1, srcRepo.getBookmarks().getActiveBookmarkName());
      assertEquals(commitCmd.getCommittedRevision(), srcRepo.getBookmarks().getRevision(bm1));
View Full Code Here

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

      errorCollector.assertEquals(srcClog.getRevision(bm2Local), srcBookmarks.getRevision(bm2));
      errorCollector.assertEquals(srcClog.getRevision(bm3Local), srcBookmarks.getRevision(bm3));
      errorCollector.assertEquals(null, srcBookmarks.getRevision(bm4));
      errorCollector.assertEquals(srcClog.getRevision(bm_4_5), srcBookmarks.getRevision(bm5));
      // now, check remote bookmarks were touched
      HgRepository dstRepo = hgLookup.detect(dstRepoLoc);
      HgBookmarks dstBookmarks = dstRepo.getBookmarks();
      final HgChangelog dstClog = dstRepo.getChangelog();
      // bm1 changed and points to newly pushed commit.
      // if the test fails (bm1 points to r8), chances are server didn't manage to update
      // bookmarks yet (there's Thread.sleep() above to give it a chance).
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.