Package com.aragost.javahg

Examples of com.aragost.javahg.BaseRepository


    }

    @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());
        KeepDeleteConflict kdc = Utils.single(ctx.getKeepDeleteConflicts());
        Assert.assertNotNull(kdc);
        Assert.assertSame(removed, repo.tip());
        Assert.assertEquals("file", kdc.getFilename());
        Assert.assertSame(changed, ctx.getSource());
        kdc.delete();
        // TODO commiting results in an error, see issue 3261
        // Changeset cs = ctx.commit();
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);
View Full Code Here

TOP

Related Classes of com.aragost.javahg.BaseRepository

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.