Package com.aragost.javahg

Examples of com.aragost.javahg.Changeset


    @Test
    public void testSet() throws IOException {
        BaseRepository repo = getTestRepository();
        BranchCommand.on(repo).set("x");
        Changeset cs = commit();
        Assert.assertEquals("x", cs.getBranch());
    }
View Full Code Here


    @Test
    public void testGraftSelf() throws IOException {
        Assume.assumeTrue(isGraftSupported());
        BaseRepository repo = getTestRepository();
        Changeset cs = createChangeset();
        GraftCommand.on(repo).execute(cs);
        List<Changeset> heads = repo.heads();
        assertSingleton(cs, heads);
    }
View Full Code Here

    @Test
    public void test() throws IOException {
        Assume.assumeTrue(isGraftSupported());
        BaseRepository repo = getTestRepository();
        Changeset base = createChangeset();
        writeFile("a");
        Changeset cs = commit();
        update(base);
        writeFile("b");
        commit();
        ConflictResolvingContext r = GraftCommand.on(repo).execute(cs);
        Assert.assertNull(r);
        Changeset tip = repo.tip();
        String source = tip.getExtra().getString("source");
        Assert.assertEquals(cs.getNode(), source);
    }
View Full Code Here

    @Test
    public void testKeepDeleteConflict() throws IOException {
        Assume.assumeTrue(isGraftSupported());
        BaseRepository repo = getTestRepository();
        writeFile("file", "");
        Changeset base = commit();
        writeFile("file", "X");
        Changeset changed = commit();
        update(base);
        RemoveCommand.on(repo).execute("file");
        Changeset removed = commit();

        GraftContext ctx = GraftCommand.on(repo).execute(changed);
        Assert.assertNotNull(ctx);
        Assert.assertTrue(ctx.getFlagConflicts().isEmpty());
        Assert.assertTrue(ctx.getMergeConflicts().isEmpty());
View Full Code Here

    @Test
    public void testMergeConflict() throws IOException {
        Assume.assumeTrue(isGraftSupported());
        BaseRepository repo = getTestRepository();
        writeFile("file", "");
        Changeset base = commit();
        writeFile("file", "X");
        Changeset changed1 = commit();
        update(base);
        writeFile("file", "Y");
        commit();

        GraftContext ctx = GraftCommand.on(repo).execute(changed1);
        Assert.assertNotNull(ctx);
        Assert.assertTrue(ctx.getFlagConflicts().isEmpty());
        Assert.assertTrue(ctx.getKeepDeleteConflicts().isEmpty());
        MergeConflict mergeConflict = Utils.single(ctx.getMergeConflicts());
        Assert.assertNotNull(mergeConflict);
        // Mercurial 2.2 will skip empty commits, so we must resolve
        // with new content.
        writeFile("file", "XY");
        mergeConflict.markResolved();
        Changeset cs = ctx.commit();
        Assert.assertNotNull(cs);
        Assert.assertEquals(changed1.getNode(), cs.getExtra().getString("source"));
    }
View Full Code Here

    @Test
    public void testWithMergeConflicts() throws IOException {
        Repository repo = getTestRepository();
        writeFile("a");
        Changeset csetA = commit();
        writeFile("b");
        writeFile("a");
        Changeset csetB = commit();
        UpdateResult result = UpdateCommand.on(repo).rev(csetA).execute();
        verifyResult(result, 1, 0, 1, 0);
        writeFile("a");
        result = UpdateCommand.on(repo).rev(csetB).execute();
        verifyResult(result, 1, 0, 0, 1);
View Full Code Here

    @Test
    public void testWithMerge() throws IOException {
        Repository repo = getTestRepository();
        writeFile("a", "1\n2\n3\n");
        Changeset csetA = commit();
        writeFile("b");
        writeFile("a", "11\n2\n3\n");
        Changeset csetB = commit();
        UpdateResult result = UpdateCommand.on(repo).rev(csetA).execute();
        verifyResult(result, 1, 0, 1, 0);
        writeFile("a", "1\n2\n\33\n");
        result = UpdateCommand.on(repo).rev(csetB).execute();
        verifyResult(result, 1, 0, 0, 1);
View Full Code Here

    @Test
    public void testWithManifestMergeConflict() throws IOException {
        Repository repo = getTestRepository();
        writeFile("a");
        Changeset csetA = commit();
        writeFile("a");
        Changeset csetB = commit();
        UpdateResult result = UpdateCommand.on(repo).rev(csetA).execute();
        verifyResult(result, 1, 0, 0, 0);
        deleteFile("a");
        ManifestMergeOracle oracle = new ManifestMergeOracle();
        result = UpdateCommand.on(repo).rev(csetB).execute(oracle);
View Full Code Here

    @Test
    public void testUpdateCrossesBranches() throws IOException {
        Repository repo = getTestRepository();
        writeFile("a");
        Changeset csetA = commit();
        writeFile("a");
        Changeset csetB = commit();

        UpdateCommand.on(repo).rev(csetA).execute();
        writeFile("a");

        commit();
View Full Code Here

        Repository repo = getTestRepository();
        CommitCommand commitCmd = CommitCommand.on(repo).message("m").user("user");
        writeFile("a", "boo");
        writeFile("b", "boo");
        AddCommand.on(repo).execute();
        Changeset baseCs = commitCmd.execute();

        writeFile("a", "bar");
        writeFile("b", "bar");
        AddCommand.on(repo).execute();
        commitCmd.execute();
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.