Package org.locationtech.geogig.api.porcelain

Examples of org.locationtech.geogig.api.porcelain.MergeOp.addCommit()


            assertTrue(childObject.isPresent());
        }

        // Merge master into Branch1
        MergeOp merge = localGeogig.geogig.command(MergeOp.class);
        MergeReport report = merge.addCommit(Suppliers.ofInstance(masterCommit))
                .setMessage("Merge").call();

        // Update master to the new merge commit
        localGeogig.geogig.command(UpdateRef.class).setName("refs/heads/master")
                .setNewValue(report.getMergeCommit().getId()).call();
View Full Code Here


        // Checkout master
        localGeogig.geogig.command(CheckoutOp.class).setSource("master").call();

        // Merge Branch1 into master
        MergeOp merge = localGeogig.geogig.command(MergeOp.class);
        MergeReport report = merge.addCommit(Suppliers.ofInstance(expected.get(0).getId()))
                .setMessage("Merge").call();

        PushOp push = push();
        push.addRefSpec("refs/heads/master").call();
View Full Code Here

        // Now try to merge all branches into master
        geogig.command(CheckoutOp.class).setSource("master").call();
        Ref branch1 = geogig.command(RefParse.class).setName("branch1").call().get();
        Ref branch2 = geogig.command(RefParse.class).setName("branch2").call().get();
        MergeOp mergeOp = geogig.command(MergeOp.class);
        mergeOp.addCommit(Suppliers.ofInstance(branch1.getObjectId()));
        mergeOp.addCommit(Suppliers.ofInstance(branch2.getObjectId()));
        try {
            mergeOp.call();
            fail();
        } catch (IllegalStateException e) {
View Full Code Here

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

            merge.setMessage(message).setProgressListener(cli.getProgressListener());
            for (String commitish : commits) {
                Optional<ObjectId> commitId;
                commitId = geogig.command(RevParse.class).setRefSpec(commitish).call();
                checkParameter(commitId.isPresent(), "Commit not found '%s'", commitish);
                merge.addCommit(Suppliers.ofInstance(commitId.get()));
            }
            MergeReport report = merge.call();
            commit = report.getMergeCommit();
        } catch (RuntimeException e) {
            if (e instanceof NothingToCommitException || e instanceof IllegalArgumentException
View Full Code Here

            throw new CommandSpecException("Repository has no HEAD, can't merge.");
        }

        MergeOp merge = geogig.command(MergeOp.class);
        merge.setAuthor(authorName.orNull(), authorEmail.orNull());
        merge.addCommit(Suppliers.ofInstance(mapped.getId()));
        merge.setMessage(mergeMessage.or("Merged revert of " + featurePath));

        try {
            final MergeReport report = merge.call();
View Full Code Here

        merge.setAuthor(authorName.orNull(), authorEmail.orNull());

        final Optional<ObjectId> oid = transaction.command(RevParse.class).setRefSpec(commit)
                .call();
        if (oid.isPresent()) {
            merge.addCommit(Suppliers.ofInstance(oid.get()));
        } else {
            throw new CommandSpecException("Couldn't resolve '" + commit + "' to a commit.");
        }

        try {
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.