Package org.locationtech.geogig.api

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


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

        geogig.command(SquashOp.class).setSince(sinceCommit).setUntil(untilCommit)
                .setMessage(message).call();
    }

}
View Full Code Here


        checkParameter(!(skip && continueRebase), "Cannot use both --skip and --continue");
        checkParameter(!(skip && abort), "Cannot use both --skip and --abort");
        checkParameter(!(abort && continueRebase), "Cannot use both --abort and --continue");

        GeoGIG geogig = cli.getGeogig();
        RebaseOp rebase = geogig.command(RebaseOp.class).setSkip(skip).setContinue(continueRebase)
                .setAbort(abort).setSquashMessage(squash);
        rebase.setProgressListener(cli.getProgressListener());

        if (arguments == null || arguments.size() == 0) {
            if (abort || skip || continueRebase) {
View Full Code Here

            }
        } else {
            checkParameter(arguments.size() < 3, "Too many arguments specified.");
            if (arguments.size() == 2) {
                // Make sure branch is valid
                Optional<ObjectId> branchRef = geogig.command(RevParse.class)
                        .setRefSpec(arguments.get(1)).call();
                checkParameter(branchRef.isPresent(), "The branch reference could not be resolved.");
                // Checkout <branch> prior to rebase
                try {
                    geogig.command(CheckoutOp.class).setSource(arguments.get(1)).call();
View Full Code Here

                Optional<ObjectId> branchRef = geogig.command(RevParse.class)
                        .setRefSpec(arguments.get(1)).call();
                checkParameter(branchRef.isPresent(), "The branch reference could not be resolved.");
                // Checkout <branch> prior to rebase
                try {
                    geogig.command(CheckoutOp.class).setSource(arguments.get(1)).call();
                } catch (CheckoutException e) {
                    throw new CommandFailedException(e.getMessage(), e);
                }

            }
View Full Code Here

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

            }

            Optional<Ref> upstreamRef = geogig.command(RefParse.class).setName(arguments.get(0))
                    .call();
            checkParameter(upstreamRef.isPresent(), "The upstream reference could not be resolved.");
            rebase.setUpstream(Suppliers.ofInstance(upstreamRef.get().getObjectId()));
        }
View Full Code Here

            checkParameter(upstreamRef.isPresent(), "The upstream reference could not be resolved.");
            rebase.setUpstream(Suppliers.ofInstance(upstreamRef.get().getObjectId()));
        }

        if (onto != null) {
            Optional<ObjectId> ontoId = geogig.command(RevParse.class).setRefSpec(onto).call();
            checkParameter(ontoId.isPresent(), "The onto reference could not be resolved.");
            rebase.setOnto(Suppliers.ofInstance(ontoId.get()));
        }

        try {
View Full Code Here

                checkParameter(ref.isPresent(), "pathspec '%s' did not match any tree", pathFilter);
                checkParameter(ref.get().getType() == TYPE.TREE,
                        "pathspec '%s' did not resolve to a tree", pathFilter);
            }
            Iterator<DiffEntry> unstaged = geogig.command(DiffWorkTree.class).setFilter(pathFilter)
                    .call();
            while (unstaged.hasNext()) {
                DiffEntry entry = unstaged.next();
                if (entry.changeType() == ChangeType.ADDED) {
                    console.println("Would remove " + entry.newPath());
View Full Code Here

                if (entry.changeType() == ChangeType.ADDED) {
                    console.println("Would remove " + entry.newPath());
                }
            }
        } else {
            geogig.command(CleanOp.class).setPath(pathFilter).call();
            console.println("Clean operation completed succesfully.");
        }
    }

}
View Full Code Here

        Platform platform = new DefaultPlatform();
        platform.setWorkingDir(new File(repo));
        Context inj = GlobalContextBuilder.builder.build();
        GeoGIG geogig = new GeoGIG(inj, platform.pwd());

        if (geogig.command(ResolveGeogigDir.class).call().isPresent()) {
            geogig.getRepository();
            return geogig;
        }

        return geogig;
View Full Code Here

    GeoGIG loadGeoGIG(String repo, GeogigCLI cli) {
        Platform platform = new DefaultPlatform();
        platform.setWorkingDir(new File(repo));

        GeoGIG geogig = new GeoGIG(cli.getGeogigInjector(), platform.pwd());
        if (geogig.command(ResolveGeogigDir.class).call().isPresent()) {
            geogig.getRepository();
        }

        return geogig;
    }
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.