Package org.locationtech.geogig.api

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


        if (rename) {
            checkParameter(!branchName.isEmpty(), "You must specify a branch to rename.");

            if (branchName.size() == 1) {
                Optional<Ref> headRef = geogig.command(RefParse.class).setName(Ref.HEAD).call();
                geogig.command(BranchRenameOp.class).setNewName(branchName.get(0)).setForce(force)
                        .call();
                if (headRef.isPresent()) {
                    SymRef ref = (SymRef) headRef.get();
                    console.println("renamed branch '"
View Full Code Here


        if (rename) {
            checkParameter(!branchName.isEmpty(), "You must specify a branch to rename.");

            if (branchName.size() == 1) {
                Optional<Ref> headRef = geogig.command(RefParse.class).setName(Ref.HEAD).call();
                geogig.command(BranchRenameOp.class).setNewName(branchName.get(0)).setForce(force)
                        .call();
                if (headRef.isPresent()) {
                    SymRef ref = (SymRef) headRef.get();
                    console.println("renamed branch '"
                            + ref.getTarget().substring(Ref.HEADS_PREFIX.length()) + "' to '"
View Full Code Here

                    console.println("renamed branch '"
                            + ref.getTarget().substring(Ref.HEADS_PREFIX.length()) + "' to '"
                            + branchName.get(0) + "'");
                }
            } else {
                geogig.command(BranchRenameOp.class).setOldName(branchName.get(0))
                        .setNewName(branchName.get(1)).setForce(force).call();
                console.println("renamed branch '" + branchName.get(0) + "' to '"
                        + branchName.get(1) + "'");
            }
            return;
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

        final GeoGIG geogig = cli.getGeogig();

        boolean local = all || !(remotes);
        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;
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

        checkParameter(!refspec.endsWith(":"), "No path specified.");

        final GeoGIG geogig = cli.getGeogig();

        Optional<ObjectId> rootTreeId = geogig.command(ResolveTreeish.class)
                .setTreeish(refspec.split(":")[0]).call();

        checkParameter(rootTreeId.isPresent(), "Couldn't resolve '" + refspec
                + "' to a treeish object");
View Full Code Here

        checkParameter(rootTreeId.isPresent(), "Couldn't resolve '" + refspec
                + "' to a treeish object");

        RevTree rootTree = geogig.getRepository().getTree(rootTreeId.get());
        Optional<NodeRef> featureTypeTree = geogig.command(FindTreeChild.class)
                .setChildPath(refspec.split(":")[1]).setParent(rootTree).setIndex(true).call();

        checkParameter(featureTypeTree.isPresent(), "pathspec '" + refspec.split(":")[1]
                + "' did not match any valid path");
View Full Code Here

                "The specified bounding box is not correct");

        osmAPIUrl = resolveAPIURL();

        Optional<OSMReport> report;
        GeogigTransaction tx = geogig.command(TransactionBegin.class).call();
        try {
            AbstractGeoGigOp<Optional<OSMReport>> cmd;
            if (update) {
                cmd = tx.command(OSMUpdateOp.class).setAPIUrl(osmAPIUrl).setRebase(rebase)
                        .setMessage(message).setProgressListener(cli.getProgressListener());
View Full Code Here

        checkParameter(!refspec.endsWith(":"), "No path specified.");

        final GeoGIG geogig = cli.getGeogig();

        Optional<ObjectId> rootTreeId = geogig.command(ResolveTreeish.class)
                .setTreeish(refspec.split(":")[0]).call();

        checkParameter(rootTreeId.isPresent(), "Couldn't resolve '" + refspec
                + "' to a treeish object");
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.