Package com.aragost.javahg.commands

Examples of com.aragost.javahg.commands.CommitCommand.execute()


            CommitCommand cmd = CommitCommand.on(repo);
            cmd.user(this.rollbackChangeset.getUser());
            cmd.date(this.rollbackChangeset.getTimestamp());
            cmd.message(this.rollbackChangeset.getMessage());
            cmd.extra("source", getSource().getNode());
            return cmd.execute();
        }
    }

    public void setRollbackChangeset(Changeset rollbackChangeset) {
        this.rollbackChangeset = rollbackChangeset;
View Full Code Here


        Repository src = Repository.open(createMercurialRepository());
        Files.write("q", new File(src.getDirectory(), "xxx"), utf8());
        AddCommand.on(src).execute();
        CommitCommand commit = CommitCommand.on(src);
        commit.user("test").message("m");
        commit.execute();
        File tgt = Files.createTempDir();
        Repository clone = Repository.clone(tgt, src.getDirectory().getAbsolutePath());
        File xxx = new File(tgt, "xxx");
        Assert.assertTrue(xxx.exists());
        clone.close();
View Full Code Here

     */
    public Changeset commit() throws IOException {
        Repository repo = getTestRepository();
        AddCommand.on(repo).execute();
        CommitCommand cmd = CommitCommand.on(repo).user("testcase").message("testcase: " + getClass().getName());
        return cmd.execute();
    }

    /**
     * Create a new changeset in the test repository.
     *
 
View Full Code Here

        writeFile("A");
        repo.workingCopy().add("A");
        try {
            // The previous config change is not forgotten
            CommitCommand commit = CommitCommand.on(repo).message("m");
            Changeset cs = commit.execute();
            assertFailedExecution(commit, "Username is " + cs.getUser());
        } catch (ExecutionException e) {
            Assert.assertTrue(e.getMessage().startsWith("no username supplied "));
        }
    }
View Full Code Here

            String fileContent = randomString(20);
            writeFile(repo, newFile, fileContent);
            AddCommand.on(repo).execute();
            CommitCommand commitCmd = CommitCommand.on(repo).user("thread: " + this.threadId).message(
                    "msg: " + this.threadId);
            Changeset x = commitCmd.execute();
            if (x != null) {
                Changeset y = repo.changeset(x.getNode());
                Assert.assertSame(x, y);
                stats.incChanges();
            } else {
View Full Code Here

                // Note that even if we check for existence before
                // calling 'hg remove', then another thread might
                // delete it before Mercurial and thus cause an error.
            }

            commitCmd.execute();
            if (commitCmd.getReturnCode() == 1) {
                // Change committed by other thread
                stats.incNoChanges();
            } else {
                stats.incChanges();
View Full Code Here

        writeFile("A");
        repo.workingCopy().add("A");
        try {
            // The previous config change is not forgotten
            CommitCommand commit = CommitCommand.on(repo).message("m");
            Changeset cs = commit.execute();
            assertFailedExecution(commit, "Username is " + cs.getUser());
        } catch (ExecutionException e) {
            // Mercurial 3.1.1 doesn't put the space at the end...
            Assert.assertTrue(e.getMessage().startsWith("no username supplied"));
        }
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.