Examples of addCommit()


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

                op.addCommit(id);
            }
        } else if (args.branch != null) {
            Optional<Ref> obj = geogig.command(RefParse.class).setName(args.branch).call();
            checkParameter(obj.isPresent(), "Wrong branch name: " + args.branch);
            op.addCommit(obj.get().getObjectId());
        }

        if (args.author != null && !args.author.isEmpty()) {
            op.setAuthor(args.author);
        }
View Full Code Here

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

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

        // 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

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

        // 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

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

        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

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

            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

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

            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

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

        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

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

        for (String st : commits) {
            Optional<ObjectId> commitId = geogig.command(RevParse.class).setRefSpec(st).call();
            checkParameter(commitId.isPresent(), "Couldn't resolve '" + st
                    + "' to a commit, aborting revert.");
            revert.addCommit(Suppliers.ofInstance(commitId.get()));
        }
        try {
            revert.setCreateCommit(!noCommit).setAbort(abort).setContinue(continueRevert).call();
        } catch (RevertConflictsException e) {
            StringBuilder sb = new StringBuilder();
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.