Package org.locationtech.geogig.api

Examples of org.locationtech.geogig.api.Ref


        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


        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(true);
        }
View Full Code Here

        verify(mockUpdateSymRef, times(1)).call();

        assertTrue(new File(workingDir, ".geogig").exists());
        assertTrue(new File(workingDir, ".geogig").isDirectory());

        Ref master = new Ref(Ref.MASTER, ObjectId.forString("hash me"));

        when(mockRefParse.call()).thenReturn(Optional.of(master));

        Context injector = mock(Context.class);
        when(injector.command(eq(RefParse.class))).thenReturn(mockRefParse);
View Full Code Here

        listener.setProgress(0f);
        listener.started();
        command.setProgressListener(listener);
        try {
            RevCommit commit = command.call();
            Ref head = geogig.command(RefParse.class).setName(Ref.HEAD).call().get();
            Preconditions.checkState(commit.getId().equals(head.getObjectId()));
            updateBranchChangeset(geogig, changeset.getId());
            listener.complete();
            console.println("Commit " + commit.getId().toString());
            console.flush();
        } catch (Exception e) {
View Full Code Here

        geogig.command(CheckoutOp.class).setSource("master").call();
        insertAndAdd(points3);
        final RevCommit c3 = geogig.command(CommitOp.class).setMessage("commit for " + idP3).call();
        insertAndAdd(lines1);
        final RevCommit c4 = geogig.command(CommitOp.class).setMessage("commit for " + idL1).call();
        Ref branch1 = geogig.command(RefParse.class).setName("branch1").call().get();
        geogig.command(MergeOp.class).addCommit(Suppliers.ofInstance(branch1.getObjectId()))
                .setMessage("My merge message.").call();
        geogig.command(SquashOp.class).setSince(c3).setUntil(c4).setMessage("Squashed").call();
        // check that the commit added after the squashed has all the parents
        ArrayList<RevCommit> log = Lists.newArrayList(geogig.command(LogOp.class)
                .setFirstParentOnly(true).call());
View Full Code Here

        final RevCommit c3 = geogig.command(CommitOp.class).setMessage("commit for " + idP3).call();
        geogig.command(CheckoutOp.class).setSource("master").call();
        insertAndAdd(lines1);
        @SuppressWarnings("unused")
        final RevCommit c4 = geogig.command(CommitOp.class).setMessage("commit for " + idL1).call();
        Ref branch1 = geogig.command(RefParse.class).setName("branch1").call().get();
        MergeReport mergeReport = geogig.command(MergeOp.class)
                .addCommit(Suppliers.ofInstance(branch1.getObjectId()))
                .setMessage("My merge message.").call();
        try {
            geogig.command(SquashOp.class).setSince(c2).setUntil(mergeReport.getMergeCommit())
                    .setMessage("Squashed").call();
        } catch (IllegalArgumentException e) {
View Full Code Here

        insertAndAdd(points3);
        final RevCommit c3 = geogig.command(CommitOp.class).setMessage("commit for " + idP3).call();
        insertAndAdd(lines1);
        @SuppressWarnings("unused")
        final RevCommit c4 = geogig.command(CommitOp.class).setMessage("commit for " + idL1).call();
        Ref branch1 = geogig.command(RefParse.class).setName("branch1").call().get();
        MergeReport mergeReport = geogig.command(MergeOp.class)
                .addCommit(Suppliers.ofInstance(branch1.getObjectId()))
                .setMessage("My merge message.").call();
        geogig.command(SquashOp.class).setSince(c3).setUntil(mergeReport.getMergeCommit())
                .setMessage("Squashed").call();
        ArrayList<RevCommit> log = Lists.newArrayList(geogig.command(LogOp.class)
                .setFirstParentOnly(true).call());
View Full Code Here

        @SuppressWarnings("unused")
        final RevCommit c3 = geogig.command(CommitOp.class).setMessage("commit for " + idP3).call();
        insertAndAdd(lines1);
        @SuppressWarnings("unused")
        final RevCommit c4 = geogig.command(CommitOp.class).setMessage("commit for " + idL1).call();
        Ref branch1 = geogig.command(RefParse.class).setName("branch1").call().get();
        MergeReport mergeReport = geogig.command(MergeOp.class)
                .addCommit(Suppliers.ofInstance(branch1.getObjectId()))
                .setMessage("My merge message.").call();
        try {
            geogig.command(SquashOp.class).setSince(c1).setUntil(mergeReport.getMergeCommit())
                    .setMessage("Squashed").call();
            fail();
View Full Code Here

        }

        final String branch = branchName.get(0);
        final String origin = branchName.size() > 1 ? branchName.get(1) : Ref.HEAD;

        Ref newBranch = geogig.command(BranchCreateOp.class).setName(branch).setForce(force)
                .setOrphan(orphan).setAutoCheckout(checkout).setSource(origin).call();

        console.println("Created branch " + newBranch.getName());
    }
View Full Code Here

        boolean remote = all || remotes;

        ImmutableList<Ref> branches = geogig.command(BranchListOp.class).setLocal(local)
                .setRemotes(remote).call();

        final Ref currentHead = geogig.command(RefParse.class).setName(Ref.HEAD).call().get();

        final int largest = verbose ? largestLenght(branches) : 0;

        for (Ref branchRef : branches) {
            final String branchRefName = branchRef.getName();
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.