Package org.tmatesoft.hg.core

Examples of org.tmatesoft.hg.core.HgCommitCommand.message()


    if (message == null) {
      System.err.println("Need a commit message");
      return;
    }
    HgCommitCommand cmd = repo.createCommitCommand();
    cmd.message(message);
    Outcome o = cmd.execute();
    if (!o.isOk()) {
      System.err.println(o.getMessage());
      return;
    }
View Full Code Here


    assertTrue("[sanity]", fileB.canRead());
    RepoUtils.modifyFileAppend(fileB, " 1 \n");

    HgCommitCommand cmd = new HgCommitCommand(hgRepo);
    assertFalse(cmd.isMergeCommit());
    Outcome r = cmd.message("FIRST").execute();
    errorCollector.assertTrue(r.isOk());
    Nodeid c1 = cmd.getCommittedRevision();
   
    // check that modified files are no longer reported as such
    TestStatus.StatusCollector status = new TestStatus.StatusCollector();
View Full Code Here

    assertTrue("[sanity]", fileD.canRead());
    //
    RepoUtils.modifyFileAppend(fileD, " 1 \n");
    cmd = new HgCommitCommand(hgRepo);
    assertFalse(cmd.isMergeCommit());
    r = cmd.message("SECOND").execute();
    errorCollector.assertTrue(r.isOk());
    Nodeid c2 = cmd.getCommittedRevision();
    //
    errorCollector.assertEquals("SECOND", hgRepo.getCommitLastMessage());
    //
View Full Code Here

    // rev0: +file1, +file2
    RepoUtils.createFile(fileA, "first file");
    RepoUtils.createFile(fileB, "second file");
    new HgAddRemoveCommand(hgRepo).add(fa, fb).execute();
    final HgCommitCommand commitCmd = new HgCommitCommand(hgRepo);
    commitCmd.message("FIRST").execute();
    // rev1: *file1, *file2
    RepoUtils.modifyFileAppend(fileA, "A1");
    RepoUtils.modifyFileAppend(fileB, "B1");
    commitCmd.message("SECOND").execute();
    // rev2: *file1, -file2
View Full Code Here

    final HgCommitCommand commitCmd = new HgCommitCommand(hgRepo);
    commitCmd.message("FIRST").execute();
    // rev1: *file1, *file2
    RepoUtils.modifyFileAppend(fileA, "A1");
    RepoUtils.modifyFileAppend(fileB, "B1");
    commitCmd.message("SECOND").execute();
    // rev2: *file1, -file2
    RepoUtils.modifyFileAppend(fileA, "A2");
    fileB.delete();
    new HgAddRemoveCommand(hgRepo).remove(fb).execute();
    commitCmd.message("THIRD").execute();
View Full Code Here

    commitCmd.message("SECOND").execute();
    // rev2: *file1, -file2
    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");
View Full Code Here

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

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

    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();
    errorCollector.assertTrue(ms.isMerging());
    errorCollector.assertFalse(ms.isStale());
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.