Package org.locationtech.geogig.api.porcelain

Examples of org.locationtech.geogig.api.porcelain.CommitOp


        ObjectId oid1 = insertAndAdd(points1);

        ObjectId oid2 = insertAndAdd(points2);

        geogig.command(AddOp.class).addPattern(".").call();
        CommitOp commitCommand = geogig.command(CommitOp.class);
        commitCommand.setAuthor("John Doe", "John@Doe.com");
        commitCommand.setCommitter("Jane Doe", "Jane@Doe.com");
        RevCommit commit = commitCommand.call();
        assertNotNull(commit);
        assertNotNull(commit.getParentIds());
        assertEquals(0, commit.getParentIds().size());
        assertFalse(commit.parentN(0).isPresent());
        assertNotNull(commit.getId());
View Full Code Here


        geogig.command(AddOp.class).addPattern(".").call();
        RevCommit commit = geogig.command(CommitOp.class).call();

        ObjectId oid = insertAndAdd(points1_modified);

        CommitOp commitCommand = geogig.command(CommitOp.class);
        commit = commitCommand.setAll(true).call();
        assertNotNull(commit);
        assertNotNull(commit.getParentIds());
        assertEquals(1, commit.getParentIds().size());
        assertNotNull(commit.getId());
View Full Code Here

        ObjectId oid = insertAndAdd(points1_modified);
        insert(points2);
        insert(lines1);

        CommitOp commitCommand = geogig.command(CommitOp.class);
        commit = commitCommand.setPathFilters(ImmutableList.of(pointsName)).setAll(true).call();
        assertNotNull(commit);
        assertNotNull(commit.getParentIds());
        assertEquals(1, commit.getParentIds().size());
        assertNotNull(commit.getId());
View Full Code Here

            fail("expected NothingToCommitException");
        } catch (NothingToCommitException e) {
            assertTrue(true);
        }

        CommitOp commitCommand = geogig.command(CommitOp.class);
        RevCommit commit = commitCommand.setAllowEmpty(true).call();
        assertNotNull(commit);
        assertNotNull(commit.getParentIds());
        assertEquals(0, commit.getParentIds().size());
        assertFalse(commit.parentN(0).isPresent());
        assertNotNull(commit.getId());
View Full Code Here

            assertTrue(true);
        }

        injector.configDatabase().remove("user.name");

        CommitOp commitCommand = geogig.command(CommitOp.class);
        exception.expect(IllegalStateException.class);
        commitCommand.setAllowEmpty(true).call();
    }
View Full Code Here

            assertTrue(true);
        }

        injector.configDatabase().remove("user.email");

        CommitOp commitCommand = geogig.command(CommitOp.class);
        exception.expect(IllegalStateException.class);
        commitCommand.setAllowEmpty(true).call();
    }
View Full Code Here

            fail("expected NothingToCommitException");
        } catch (NothingToCommitException e) {
            assertTrue(true);
        }

        CommitOp commitCommand1 = geogig.command(CommitOp.class);
        commitCommand1.setProgressListener(listener1);
        assertNull(commitCommand1.setAllowEmpty(true).call());

        CommitOp commitCommand2 = geogig.command(CommitOp.class);
        commitCommand2.setProgressListener(listener2);
        assertNull(commitCommand2.setAllowEmpty(true).call());

        CommitOp commitCommand3 = geogig.command(CommitOp.class);
        commitCommand3.setProgressListener(listener3);
        assertNull(commitCommand3.setAllowEmpty(true).call());
    }
View Full Code Here

        final String emptyTreeName = "emptyTree";

        workingTree.createTypeTree(emptyTreeName, pointsType);
        geogig.command(AddOp.class).addPattern(emptyTreeName).call();

        CommitOp commitCommand = geogig.command(CommitOp.class);
        RevCommit commit = commitCommand.call();
        assertNotNull(commit);

        RevTree head = geogig.command(RevObjectParse.class).setObjectId(commit.getTreeId())
                .call(RevTree.class).get();
        Optional<NodeRef> ref = geogig.command(FindTreeChild.class).setChildPath(emptyTreeName)
View Full Code Here

            List<DiffEntry> staged = toList(index.getStaged(null));
            assertEquals(staged.toString(), 1, staged.size());
            // assertEquals(NodeRef.ROOT, staged.get(0).newName());
            assertEquals(emptyTreeName, staged.get(0).newName());
        }
        CommitOp commitCommand = geogig.command(CommitOp.class);
        RevCommit commit = commitCommand.call();
        assertNotNull(commit);

        RevTree head = geogig.command(RevObjectParse.class).setObjectId(commit.getTreeId())
                .call(RevTree.class).get();
        Optional<NodeRef> ref = geogig.command(FindTreeChild.class).setChildPath(emptyTreeName)
View Full Code Here

        final String author = fullName.isPresent() ? fullName.get() : txUserName.orNull();
        String commitMessage = getTransactionProperty(VERSIONING_COMMIT_MESSAGE).orNull();

        this.geogigTx.command(AddOp.class).call();
        try {
            CommitOp commitOp = this.geogigTx.command(CommitOp.class);
            if (txUserName != null) {
                commitOp.setAuthor(author, email.orNull());
            }
            if (commitMessage == null) {
                commitMessage = composeDefaultCommitMessage();
            }
            commitOp.setMessage(commitMessage);
            commitOp.call();
        } catch (NothingToCommitException nochanges) {
            // ok
        }

        try {
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.porcelain.CommitOp

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.