Package org.locationtech.geogig.api

Examples of org.locationtech.geogig.api.GeogigTransaction.command()


        // start the second transaction
        GeogigTransaction transaction2 = geogig.command(TransactionBegin.class).call();

        // make a new branch
        transaction2.command(BranchCreateOp.class).setAutoCheckout(true).setName("branch1").call();

        // perform a commit in the transaction
        insertAndAdd(transaction2, points3);
        RevCommit transaction2Commit = transaction2.command(CommitOp.class).setMessage("Commit3")
                .call();
View Full Code Here


        // make a new branch
        transaction2.command(BranchCreateOp.class).setAutoCheckout(true).setName("branch1").call();

        // perform a commit in the transaction
        insertAndAdd(transaction2, points3);
        RevCommit transaction2Commit = transaction2.command(CommitOp.class).setMessage("Commit3")
                .call();

        // Verify that the base repository is unchanged
        logs = geogig.command(LogOp.class).call();
        assertEquals(logs.next(), mainCommit);
View Full Code Here

        logs = geogig.command(LogOp.class).call();
        assertEquals(logs.next(), mainCommit);
        assertFalse(logs.hasNext());

        // Verify that the transaction has the commit
        logs = transaction2.command(LogOp.class).call();
        assertEquals(logs.next(), transaction2Commit);
        assertEquals(logs.next(), mainCommit);
        assertFalse(logs.hasNext());

        // Commit the first transaction
View Full Code Here

        // start a transaction
        GeogigTransaction t = geogig.command(TransactionBegin.class).call();

        // perform a commit in the transaction
        insertAndAdd(t, points2);
        commit = t.command(CommitOp.class).call();

        // Verify that the base repository is unchanged
        Iterator<RevCommit> logs = geogig.command(LogOp.class).call();
        List<RevCommit> logged = new ArrayList<RevCommit>();
        for (; logs.hasNext();) {
View Full Code Here

        // start a transaction
        GeogigTransaction t = geogig.command(TransactionBegin.class).call();

        // perform a commit in the transaction
        insertAndAdd(t, points2);
        t.command(CommitOp.class).call();

        // End the transaction
        exception.expect(IllegalStateException.class);
        t.command(TransactionEnd.class).setTransaction(t).call();
View Full Code Here

        insertAndAdd(t, points2);
        t.command(CommitOp.class).call();

        // End the transaction
        exception.expect(IllegalStateException.class);
        t.command(TransactionEnd.class).setTransaction(t).call();

    }

    @Test
    public void testBeginWithinTransaction() throws Exception {
View Full Code Here

        // start a transaction
        GeogigTransaction t = geogig.command(TransactionBegin.class).call();

        // start a transaction within the transaction
        exception.expect(IllegalStateException.class);
        t.command(TransactionBegin.class).call();

    }

    @Test
    public void testCommitUpdatesRemoteRefs() throws Exception {
View Full Code Here

        // start a transaction
        GeogigTransaction tx = geogig.command(TransactionBegin.class).call();

        // make a commit
        insertAndAdd(tx, points2);
        RevCommit newcommit = tx.command(CommitOp.class).call();
        // upadte remote
        Ref txRemoteHead = tx.command(UpdateRef.class).setName(remoteRef)
                .setNewValue(newcommit.getId()).call().get();
        assertEquals(newcommit.getId(), txRemoteHead.getObjectId());
View Full Code Here

        // make a commit
        insertAndAdd(tx, points2);
        RevCommit newcommit = tx.command(CommitOp.class).call();
        // upadte remote
        Ref txRemoteHead = tx.command(UpdateRef.class).setName(remoteRef)
                .setNewValue(newcommit.getId()).call().get();
        assertEquals(newcommit.getId(), txRemoteHead.getObjectId());

        // commit transaction
        tx.commit();
View Full Code Here

        }

        // Do not use the geogig instance after this, but the tx one!
        GeogigTransaction tx = geogig.command(TransactionBegin.class).call();
        try {
            Optional<Ref> oldRef = tx.command(RefParse.class).setName(refspec).call();
            Optional<Ref> headRef = tx.command(RefParse.class).setName(Ref.HEAD).call();
            String refName = refspec;
            if (oldRef.isPresent()) {
                if (oldRef.get().getObjectId().equals(newCommit)) {
                    LOGGER.info("ref '{}' -> {} not updated, got same id", refName, newCommit);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.