Package org.locationtech.geogig.api

Examples of org.locationtech.geogig.api.Ref


        insert(points1ModifiedB);
        delete(points2);
        geogig.command(AddOp.class).call();
        RevCommit branchCommit = geogig.command(CommitOp.class).setMessage("branch commit").call();
        geogig.command(CheckoutOp.class).setSource("master").call();
        Ref branch1 = geogig.command(RefParse.class).setName("branch1").call().get();

        try {
            geogig.command(RebaseOp.class).setUpstream(Suppliers.ofInstance(branch1.getObjectId()))
                    .call();
            fail();
        } catch (RebaseConflictsException e) {
            assertTrue(e.getMessage().contains("conflict"));
        }
View Full Code Here


        insert(points1ModifiedB);
        delete(points2);
        geogig.command(AddOp.class).call();
        RevCommit branchCommit = geogig.command(CommitOp.class).setMessage("branch commit").call();
        geogig.command(CheckoutOp.class).setSource("master").call();
        Ref branch1 = geogig.command(RefParse.class).setName("branch1").call().get();

        try {
            geogig.command(RebaseOp.class).setUpstream(Suppliers.ofInstance(branch1.getObjectId()))
                    .setSquashMessage("squashed commit").call();
            fail();
        } catch (RebaseConflictsException e) {
            assertTrue(e.getMessage().contains("conflict"));
        }
View Full Code Here

        insert(points1ModifiedB);
        delete(points2);
        geogig.command(AddOp.class).call();
        RevCommit branchCommit = geogig.command(CommitOp.class).setMessage("branch commit").call();
        geogig.command(CheckoutOp.class).setSource("master").call();
        Ref branch1 = geogig.command(RefParse.class).setName("branch1").call().get();

        try {
            geogig.command(RebaseOp.class).setUpstream(Suppliers.ofInstance(branch1.getObjectId()))
                    .call();
            fail();
        } catch (RebaseConflictsException e) {
            assertTrue(e.getMessage().contains("conflict"));
        }
View Full Code Here

        insert(points1ModifiedB);
        delete(points2);
        geogig.command(AddOp.class).call();
        geogig.command(CommitOp.class).setMessage("branch commit").call();
        geogig.command(CheckoutOp.class).setSource("master").call();
        Ref branch1 = geogig.command(RefParse.class).setName("branch1").call().get();

        try {
            geogig.command(RebaseOp.class).setUpstream(Suppliers.ofInstance(branch1.getObjectId()))
                    .call();
            fail();
        } catch (RebaseConflictsException e) {
            assertTrue(e.getMessage().contains("conflict"));
        }
View Full Code Here

    @Test
    public void RenamingABranchTest() throws Exception {
        insertAndAdd(points1);
        geogig.command(AddOp.class).call();
        geogig.command(CommitOp.class).call();
        Ref TestBranch = geogig.command(BranchCreateOp.class).setName("TestBranch").call();

        Ref SuperTestBranch = geogig.command(BranchRenameOp.class).setOldName("TestBranch")
                .setNewName("SuperTestBranch").call();

        Optional<Ref> result = geogig.command(RefParse.class).setName("TestBranch").call();

        assertFalse(result.isPresent());

        result = geogig.command(RefParse.class).setName("SuperTestBranch").call();

        assertTrue(result.isPresent());

        assertEquals(TestBranch.getObjectId(), SuperTestBranch.getObjectId());
    }
View Full Code Here

    @Test
    public void NoOldNameTest() throws Exception {
        insertAndAdd(points1);
        geogig.command(AddOp.class).call();
        geogig.command(CommitOp.class).call();
        Ref TestBranch = geogig.command(BranchCreateOp.class).setName("TestBranch")
                .setAutoCheckout(true).call();

        Ref SuperTestBranch = geogig.command(BranchRenameOp.class).setNewName("SuperTestBranch")
                .call();

        Optional<Ref> result = geogig.command(RefParse.class).setName("TestBranch").call();

        assertFalse(result.isPresent());

        result = geogig.command(RefParse.class).setName("SuperTestBranch").call();

        assertTrue(result.isPresent());

        assertEquals(TestBranch.getObjectId(), SuperTestBranch.getObjectId());
    }
View Full Code Here

    @Test
    public void ForceRenameTest() throws Exception {
        insertAndAdd(points1);
        geogig.command(AddOp.class).call();
        geogig.command(CommitOp.class).call();
        Ref TestBranch1 = geogig.command(BranchCreateOp.class).setName("TestBranch1").call();

        geogig.command(BranchCreateOp.class).setName("TestBranch2").setAutoCheckout(true).call();
        insertAndAdd(points2);
        geogig.command(AddOp.class).call();
        geogig.command(CommitOp.class).setMessage("this should be deleted").call();

        geogig.command(CheckoutOp.class).setSource("TestBranch1").call();

        Ref SuperTestBranch = geogig.command(BranchRenameOp.class).setNewName("TestBranch2")
                .setForce(true).call();

        Optional<Ref> result = geogig.command(RefParse.class).setName("TestBranch1").call();

        assertFalse(result.isPresent());

        result = geogig.command(RefParse.class).setName("TestBranch2").call();

        assertTrue(result.isPresent());

        assertEquals(TestBranch1.getObjectId(), SuperTestBranch.getObjectId());

        exception.expect(IllegalStateException.class);
        geogig.command(BranchRenameOp.class).setNewName("master").call();
    }
View Full Code Here

        geogig.command(InitOp.class).call();

        masterCommit1 = commit("masterCommit1");
        masterCommit2 = commit("masterCommit2");

        Ref branch = geogig.command(BranchCreateOp.class).setName("BRANCH")
                .setSource(masterCommit2.getId().toString()).setAutoCheckout(true).call();
        assertEquals(masterCommit2.getId(), branch.getObjectId());

        branchCommit1 = commit("branchCommit1");
        branchCommit2 = commit("branchCommit2");

        geogig.command(CheckoutOp.class).setSource("master").call();
View Full Code Here

    @Test
    public void testOrphan() throws Exception {
        insertAndAdd(points1);
        geogig.command(CommitOp.class).setMessage("Commit1").call();
        Ref branch1 = geogig.command(BranchCreateOp.class).setName("branch1").setAutoCheckout(true)
                .setOrphan(true).call();

        assertEquals(ObjectId.NULL, branch1.getObjectId());
        assertEquals(Ref.HEADS_PREFIX + "branch1", branch1.getName());
    }
View Full Code Here

        insertAndAdd(points1ModifiedB);
        insertAndAdd(points2);
        geogig.command(CommitOp.class).call();

        geogig.command(CheckoutOp.class).setSource("master").call();
        Ref branch = geogig.command(RefParse.class).setName("TestBranch").call().get();
        try {
            geogig.command(MergeOp.class).addCommit(Suppliers.ofInstance(branch.getObjectId()))
                    .call();
            fail();
        } catch (MergeConflictsException e) {
            assertTrue(e.getMessage().contains("conflict"));
        }
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.Ref

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.