Package org.locationtech.geogig.api

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


    public void runInternal(GeogigCLI cli) throws IOException {

        ConsoleReader console = cli.getConsole();
        GeoGIG geogig = cli.getGeogig();

        ForEachRef op = geogig.command(ForEachRef.class);

        Predicate<Ref> filter = new Predicate<Ref>() {
            @Override
            public boolean apply(Ref ref) {
                String name = ref.getName();
View Full Code Here


        ConsoleReader console = cli.getConsole();
        GeoGIG geogig = cli.getGeogig();

        String path = paths.get(0);

        Optional<RevObject> obj = geogig.command(RevObjectParse.class).setRefSpec(path).call();
        checkParameter(obj.isPresent(), "refspec did not resolve to any object.");
        if (binary) {
            ObjectSerializingFactory factory = DataStreamSerializationFactoryV1.INSTANCE;
            ObjectWriter<RevObject> writer = factory.createObjectWriter(obj.get().getType());
            writer.write(obj.get(), System.out);
View Full Code Here

        if (binary) {
            ObjectSerializingFactory factory = DataStreamSerializationFactoryV1.INSTANCE;
            ObjectWriter<RevObject> writer = factory.createObjectWriter(obj.get().getType());
            writer.write(obj.get(), System.out);
        } else {
            CharSequence s = geogig.command(CatObject.class)
                    .setObject(Suppliers.ofInstance(obj.get())).call();
            console.println(s);
        }
    }
View Full Code Here

        checkParameter(limit >= 0, "Limit must be 0 or greater.");

        ConsoleReader console = cli.getConsole();
        GeoGIG geogig = cli.getGeogig();

        StatusOp op = geogig.command(StatusOp.class);
        StatusSummary summary = op.call();

        final Optional<Ref> currHead = geogig.command(RefParse.class).setName(Ref.HEAD).call();
        checkParameter(currHead.isPresent(), "Repository has no HEAD.");
View Full Code Here

        GeoGIG geogig = cli.getGeogig();

        StatusOp op = geogig.command(StatusOp.class);
        StatusSummary summary = op.call();

        final Optional<Ref> currHead = geogig.command(RefParse.class).setName(Ref.HEAD).call();
        checkParameter(currHead.isPresent(), "Repository has no HEAD.");

        if (currHead.get() instanceof SymRef) {
            final SymRef headRef = (SymRef) currHead.get();
            console.println("# On branch " + Ref.localName(headRef.getTarget()));
View Full Code Here

                scope = ConfigScope.GLOBAL;
            } else if (local) {
                scope = ConfigScope.LOCAL;
            }

            final Optional<Map<String, String>> commandResult = geogig.command(ConfigOp.class)
                    .setScope(scope).setAction(action).setName(name).setValue(value).call();

            if (commandResult.isPresent()) {
                switch (action) {
                case CONFIG_GET: {
View Full Code Here

    protected void runInternal(GeogigCLI cli) throws IOException {
        checkParameter(commits.size() > 0 || abort || continueRevert,
                "nothing specified for reverting");

        final GeoGIG geogig = cli.getGeogig();
        RevertOp revert = geogig.command(RevertOp.class);

        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.");
View Full Code Here

        final GeoGIG geogig = cli.getGeogig();
        RevertOp revert = geogig.command(RevertOp.class);

        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 {
View Full Code Here

    public void runInternal(GeogigCLI cli) {
        checkParameter(commits.size() == 2, "2 commit references must be supplied");

        final GeoGIG geogig = cli.getGeogig();

        Optional<ObjectId> sinceId = geogig.command(RevParse.class).setRefSpec(commits.get(0))
                .call();
        checkParameter(sinceId.isPresent(), "'since' reference cannot be found");
        checkParameter(geogig.getRepository().commitExists(sinceId.get()),
                "'since' reference does not resolve to a commit");
        RevCommit sinceCommit = geogig.getRepository().getCommit(sinceId.get());
View Full Code Here

        checkParameter(sinceId.isPresent(), "'since' reference cannot be found");
        checkParameter(geogig.getRepository().commitExists(sinceId.get()),
                "'since' reference does not resolve to a commit");
        RevCommit sinceCommit = geogig.getRepository().getCommit(sinceId.get());

        Optional<ObjectId> untilId = geogig.command(RevParse.class).setRefSpec(commits.get(1))
                .call();
        checkParameter(untilId.isPresent(), "'until' reference cannot be found");
        checkParameter(geogig.getRepository().commitExists(untilId.get()),
                "'until' reference does not resolve to a commit");
        RevCommit untilCommit = geogig.getRepository().getCommit(untilId.get());
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.