Examples of HgCheckoutCommand


Examples of org.tmatesoft.hg.core.HgCheckoutCommand

      final RevisionSet allDraft = phaseHelper.allDraft();
      assertFalse("[sanity]", allDraft.isEmpty());
      final int publicCsetToBranchAt = 4;
      assertEquals("[sanity]", HgPhase.Public, phaseHelper.getPhase(publicCsetToBranchAt, null));
      // in addition to existing draft csets, add one more draft, branching at some other public revision
      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());
      Nodeid newCommit = commitCmd.getCommittedRevision();
      //
View Full Code Here

Examples of org.tmatesoft.hg.core.HgCheckoutCommand

    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());
      final Nodeid newCommit = commitCmd.getCommittedRevision();
      //
View Full Code Here

Examples of org.tmatesoft.hg.core.HgCheckoutCommand

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

Examples of org.tmatesoft.hg.core.HgCheckoutCommand

    new HgCommitCommand(hgRepo).message("SECOND").execute();
    //
    assertEquals(2, hgRepo.getChangelog().getRevisionCount());
    errorCollector.assertEquals("SECOND", hgRepo.getCommitLastMessage());
    // checkout previous version
    new HgCheckoutCommand(hgRepo).changeset(0).clean(true).execute();
    assertTrue(fileA.isFile());
    assertTrue(fileB.isFile());
    assertFalse(fileC.isFile());
    // branch/two heads
    RepoUtils.modifyFileAppend(fileA, "A1");
    RepoUtils.modifyFileAppend(fileB, "B1");
    new HgCommitCommand(hgRepo).message("THIRD").execute();
    //
    new HgCheckoutCommand(hgRepo).changeset(1).clean(true).execute();
    assertTrue(fileA.isFile());
    assertFalse(fileB.isFile());
    assertTrue(fileC.isFile());
    RepoUtils.modifyFileAppend(fileA, "A2");
    RepoUtils.modifyFileAppend(fileC, "C1");
View Full Code Here

Examples of org.tmatesoft.hg.core.HgCheckoutCommand

    RepoUtils.modifyFileAppend(fileA, "A2");
    fileB.delete();
    new HgAddRemoveCommand(hgRepo).remove(fb).execute();
    commitCmd.message("THIRD").execute();
    // rev3: fork rev0, +file3, *file2
    new HgCheckoutCommand(hgRepo).changeset(0).clean(true).execute();
    final File fileC = new File(repoLoc, fc.toString());
    RepoUtils.createFile(fileC, "third file");
    RepoUtils.modifyFileAppend(fileB, "B2");
    new HgAddRemoveCommand(hgRepo).add(fc).execute();
    commitCmd.message("FOURTH").execute();
    // rev4: *file3
    RepoUtils.modifyFileAppend(fileC, "C1");
    commitCmd.message("FIFTH").execute();
    // rev5: merge rev2 with rev3
    new HgCheckoutCommand(hgRepo).changeset(2).clean(true).execute();
    new HgMergeCommand(hgRepo).changeset(3).execute(new HgMergeCommand.MediatorBase());
    commitCmd.message("SIXTH: merge rev2 and rev3");
    errorCollector.assertTrue(commitCmd.isMergeCommit());
    HgMergeState ms = hgRepo.getMergeState();
    ms.refresh();
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.