Package com.aragost.javahg

Examples of com.aragost.javahg.Changeset


            int port = serveState.getPort();

            Repository repoB = getTestRepository2();
            List<Changeset> changesets = PullCommand.on(repoB).execute("http://localhost:" + port);
            Assert.assertEquals(1, changesets.size());
            Changeset cs = changesets.get(0);
            Assert.assertEquals("user", cs.getUser());
            Assert.assertEquals("added x", cs.getMessage());
        } finally {
            serveState.stop();
        }
    }
View Full Code Here


    public void testNonEmpty() throws IOException {
        Repository repo = getTestRepository();
        Repository repo2 = getTestRepository2();

        writeFile("a");
        Changeset cs = commit();

        List<Changeset> csets = OutgoingCommand.on(repo).execute(repo2);
        Assert.assertEquals(1, csets.size());
        Changeset bundleCs = csets.get(0);
        Assert.assertEquals(cs.getNode(), bundleCs.getNode());
        Assert.assertEquals(cs, bundleCs);
    }
View Full Code Here

    }

    @Test
    public void testNonEmpty() throws IOException {
        Repository repo = getTestRepository();
        Changeset cs0 = createChangeset();
        Changeset cs1 = createChangeset();

        Repository repo2 = getTestRepository2();

        Bundle bundle = IncomingCommand.on(repo2).execute(repo);
        List<Changeset> changesets = bundle.getChangesets();
        Assert.assertEquals(2, changesets.size());
        // The changesets are not the same objects, because one set is
        // in the base repo, while the other set is in the overlay
        // repo
        Assert.assertEquals(cs0.getNode(), changesets.get(0).getNode());
        Assert.assertEquals(cs1.getNode(), changesets.get(1).getNode());
        Changeset bundleCs = changesets.get(0);
        Assert.assertNotSame(cs0, bundleCs);
        Assert.assertFalse(cs0.equals(bundleCs));
        bundle.close();
    }
View Full Code Here

            Repository repoB = getTestRepository2();
            Bundle b = IncomingCommand.on(repoB).execute("http://localhost:" + port);
            List<Changeset> changesets = b.getChangesets();
            Assert.assertEquals(1, changesets.size());
            Changeset cs = changesets.get(0);
            Assert.assertEquals("user", cs.getUser());
            Assert.assertEquals("added x", cs.getMessage());

            List<Changeset> heads = b.getOverlayRepository().heads();
            Assert.assertEquals(1, heads.size());
            Assert.assertEquals(cs, heads.get(0));
        } finally {
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 {
                // Change committed by other thread
                stats.incNoChanges();
View Full Code Here

    public void test() throws IOException {
        Repository repo = getTestRepository();
        writeFile("a", "a");
        writeFile("b", "b");
        writeFile("c", "c");
        Changeset csBase = commit();
        writeFile("a", "A");
        writeFile("b", "B");
        commit();
        update(csBase);
        writeFile("a", "1");
View Full Code Here

        createChangeset();
        BookmarksCommand.on(repo).create("a");
        Bookmark bm = Utils.single(BookmarksCommand.on(repo).list());
        Assert.assertTrue(bm.isActive());

        Changeset cs2 = createChangeset();
        bm = Utils.single(BookmarksCommand.on(repo).list());
        Assert.assertSame(cs2, bm.getChangeset());
        Assert.assertTrue(bm.isActive());
    }
View Full Code Here

        Assert.assertTrue(BookmarksCommand.on(repo).list().isEmpty());
       
        BookmarksCommand.on(repo).inactive().create("bookmark");
        createChangeset();
        BookmarksCommand.on(repo).create("a");
        Changeset cs = createChangeset();

        List<Bookmark> list = BookmarksCommand.on(repo).list();
        Assert.assertEquals(2, list.size());
        Bookmark bm = list.get(0);
        Assert.assertEquals("a", bm.getName());
View Full Code Here

public class RollbackCommandTest extends AbstractTestCase {

    @Test
    public void test() throws IOException {
        BaseRepository repo = getTestRepository();
        Changeset cs1 = createChangeset();
        createChangeset();
        Changeset newTip = RollbackCommand.on(repo).execute();
        Assert.assertSame(cs1, newTip);
        Assert.assertEquals(1, repo.workingCopy().status().getModified().size());
        // The following commit might fail, see mercurial issue 3261
        // TODO How to handle cases like this?
        //createChangeset();
View Full Code Here

TOP

Related Classes of com.aragost.javahg.Changeset

Copyright © 2018 www.massapicom. 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.