Package org.locationtech.geogig.api.porcelain.MergeOp

Examples of org.locationtech.geogig.api.porcelain.MergeOp.MergeReport


        // .\|/
        // . o - master - HEAD - Merge commit

        Ref branch1 = geogig.command(RefParse.class).setName("branch1").call().get();
        Ref branch2 = geogig.command(RefParse.class).setName("branch2").call().get();
        final MergeReport mergeReport = geogig.command(MergeOp.class)
                .addCommit(Suppliers.ofInstance(branch1.getObjectId()))
                .addCommit(Suppliers.ofInstance(branch2.getObjectId()))
                .setMessage("My merge message.").call();

        RevTree mergedTree = repo.getTree(mergeReport.getMergeCommit().getTreeId());

        String path = appendChild(pointsName, points1.getIdentifier().getID());
        assertTrue(repo.command(FindTreeChild.class).setParent(mergedTree).setChildPath(path)
                .call().isPresent());
View Full Code Here


        // o | - Lines 1 added
        // |/
        // o - master - HEAD - Merge commit

        Ref branch1 = geogig.command(RefParse.class).setName("branch1").call().get();
        final MergeReport mergeReport = geogig.command(MergeOp.class)
                .addCommit(Suppliers.ofInstance(branch1.getObjectId())).call();

        RevTree mergedTree = repo.getTree(mergeReport.getMergeCommit().getTreeId());

        String path = appendChild(pointsName, points2.getIdentifier().getID());
        assertTrue(repo.command(FindTreeChild.class).setParent(mergedTree).setChildPath(path)
                .call().isPresent());
View Full Code Here

        // o - Points 1 added
        // |
        // o - master - HEAD - branch1 - Points 2 added

        Ref branch1 = geogig.command(RefParse.class).setName("branch1").call().get();
        final MergeReport mergeReport = geogig.command(MergeOp.class)
                .addCommit(Suppliers.ofInstance(branch1.getObjectId())).call();

        RevTree mergedTree = repo.getTree(mergeReport.getMergeCommit().getTreeId());

        String path = appendChild(pointsName, points1.getIdentifier().getID());
        assertTrue(repo.command(FindTreeChild.class).setParent(mergedTree).setChildPath(path)
                .call().isPresent());
View Full Code Here

        // o
        // |
        // o - master - HEAD - branch1 - Points 1 added

        Ref branch1 = geogig.command(RefParse.class).setName("branch1").call().get();
        final MergeReport mergeReport = geogig.command(MergeOp.class)
                .addCommit(Suppliers.ofInstance(branch1.getObjectId())).call();

        RevTree mergedTree = repo.getTree(mergeReport.getMergeCommit().getTreeId());

        String path = appendChild(pointsName, points1.getIdentifier().getID());
        assertTrue(repo.command(FindTreeChild.class).setParent(mergedTree).setChildPath(path)
                .call().isPresent());
View Full Code Here

                    if (rebase) {
                        command(RebaseOp.class).setUpstream(
                                Suppliers.ofInstance(sourceRef.get().getObjectId())).call();
                    } else {
                        try {
                            MergeReport report = command(MergeOp.class)
                                    .setAuthor(authorName.orNull(), authorEmail.orNull())
                                    .addCommit(Suppliers.ofInstance(sourceRef.get().getObjectId()))
                                    .call();
                            result.setMergeReport(Optional.of(report));
                        } catch (NothingToCommitException e) {
View Full Code Here

        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) {
            assertTrue(e.getMessage().equals(
                    "Cannot reach 'since' from 'until' commit through first parentage"));
        }
View Full Code Here

        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());
        assertEquals(2, log.size());
        ImmutableList<ObjectId> parents = log.get(0).getParentIds();
View Full Code Here

        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();
        } catch (IllegalArgumentException e) {
            assertTrue(e
                    .getMessage()
View Full Code Here

                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
                    || e instanceof IllegalStateException) {
                throw new CommandFailedException(e.getMessage(), e);
            }
View Full Code Here

        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();

            context.setResponseContent(new CommandResponse() {
                @Override
                public void write(ResponseWriter out) throws Exception {
                    out.start();
                    out.writeMergeResponse(Optional.fromNullable(report.getMergeCommit()), report
                            .getReport().get(), geogig, report.getOurs(), report.getPairs().get(0)
                            .getTheirs(), report.getPairs().get(0).getAncestor());
                    out.finish();
                }
            });
        } catch (Exception e) {
            final RevCommit ours = context.getGeoGIG().getRepository()
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.porcelain.MergeOp.MergeReport

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.