Package org.locationtech.geogig.api

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


        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


        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

    public void runInternal(GeogigCLI cli) {
        final GeoGIG geogig = cli.getGeogig();
        checkParameter(commits.size() > 0, "No commits specified.");
        checkParameter(commits.size() < 2, "Too many commits specified.");

        CherryPickOp cherryPick = geogig.command(CherryPickOp.class);

        Optional<ObjectId> commitId;
        commitId = geogig.command(RevParse.class).setRefSpec(commits.get(0)).call();
        checkParameter(commitId.isPresent(), "Commit not found '%s'", commits.get(0));
        cherryPick.setCommit(Suppliers.ofInstance(commitId.get()));
View Full Code Here

        checkParameter(commits.size() < 2, "Too many commits specified.");

        CherryPickOp cherryPick = geogig.command(CherryPickOp.class);

        Optional<ObjectId> commitId;
        commitId = geogig.command(RevParse.class).setRefSpec(commits.get(0)).call();
        checkParameter(commitId.isPresent(), "Commit not found '%s'", commits.get(0));
        cherryPick.setCommit(Suppliers.ofInstance(commitId.get()));

        cherryPick.call();
View Full Code Here

            pathFilter = patterns.get(0);
        } else if (patterns.size() > 1) {
            throw new InvalidParameterException("Only a single path is supported so far");
        }

        List<Conflict> conflicts = geogig.command(ConflictsReadOp.class).call();

        console.print("Counting unstaged elements...");
        console.flush();
        DiffObjectCount unstaged = geogig.getRepository().workingTree().countUnstaged(pathFilter);
        if (0 == unstaged.count() && conflicts.isEmpty()) {
View Full Code Here

        } else {
            console.println(String.valueOf(unstaged.count()));
        }

        console.println("Staging changes...");
        AddOp op = geogig.command(AddOp.class);
        if (patterns.size() == 1) {
            op.addPattern(patterns.get(0));
        }

        WorkingTree workTree = op.setUpdateOnly(updateOnly)
View Full Code Here

            for (int i = 0; args != null && i < args.size(); i++) {
                reset.addPattern(args.get(i));
            }

            if (commit != null && commit.size() > 0) {
                Optional<ObjectId> commitId = geogig.command(RevParse.class)
                        .setRefSpec(commit.get(0)).call();
                checkParameter(commitId.isPresent(), "Commit could not be resolved.");
                reset.setCommit(Suppliers.ofInstance(commitId.get()));
            }
View Full Code Here

            throw new CommandFailedException(ise.getMessage(), ise);
        }

        if (!geogig.getRepository().workingTree().isClean()) {
            try {
                Iterator<DiffEntry> unstaged = geogig.command(DiffWorkTree.class).setFilter(null)
                        .call();
                cli.getConsole().println("Unstaged changes after reset:");
                while (unstaged.hasNext()) {
                    DiffEntry entry = unstaged.next();
                    ChangeType type = entry.changeType();
View Full Code Here

            }
            repoExisted = determineIfRepoExists(targetDirectory, geogig);
            final Map<String, String> suppliedConfiguration = splitConfig(config);

            try {
                repository = geogig.command(InitOp.class).setConfig(suppliedConfiguration)
                        .setTarget(targetDirectory).call();
            } catch (IllegalArgumentException e) {
                throw new CommandFailedException(e.getMessage(), e);
            } finally {
                geogig.close();
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.