Package org.locationtech.geogig.api

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


                }
                final SymRef headRef = (SymRef) currHead.get();
                destinationref = headRef.getTarget();
            }

            Optional<Ref> destRef = geogig.command(RefParse.class).setName(destinationref).call();
            final RevCommit theirs = context.getGeoGIG().getRepository()
                    .getCommit(sourceRef.get().getObjectId());
            final RevCommit ours = context.getGeoGIG().getRepository()
                    .getCommit(destRef.get().getObjectId());
            final Optional<ObjectId> ancestor = geogig.command(FindCommonAncestor.class)
View Full Code Here


            Optional<Ref> destRef = geogig.command(RefParse.class).setName(destinationref).call();
            final RevCommit theirs = context.getGeoGIG().getRepository()
                    .getCommit(sourceRef.get().getObjectId());
            final RevCommit ours = context.getGeoGIG().getRepository()
                    .getCommit(destRef.get().getObjectId());
            final Optional<ObjectId> ancestor = geogig.command(FindCommonAncestor.class)
                    .setLeft(ours).setRight(theirs).call();
            context.setResponseContent(new CommandResponse() {
                final MergeScenarioReport report = geogig.command(ReportMergeScenarioOp.class)
                        .setMergeIntoCommit(ours).setToMergeCommit(theirs).call();
View Full Code Here

            final RevCommit ours = context.getGeoGIG().getRepository()
                    .getCommit(destRef.get().getObjectId());
            final Optional<ObjectId> ancestor = geogig.command(FindCommonAncestor.class)
                    .setLeft(ours).setRight(theirs).call();
            context.setResponseContent(new CommandResponse() {
                final MergeScenarioReport report = geogig.command(ReportMergeScenarioOp.class)
                        .setMergeIntoCommit(ours).setToMergeCommit(theirs).call();

                @Override
                public void write(ResponseWriter out) throws Exception {
                    out.start();
View Full Code Here

     */
    @Override
    public void run(CommandContext context) {
        final Context geogig = this.getCommandLocator(context);
        final List<FeatureTypeStats> stats = Lists.newArrayList();
        LogOp logOp = geogig.command(LogOp.class).setFirstParentOnly(true);
        final Iterator<RevCommit> log;
        if (since != null && !since.trim().isEmpty()) {
            Date untilTime = new Date();
            Date sinceTime = new Date(geogig.command(ParseTimestamp.class).setString(since).call());
            logOp.setTimeRange(new Range<Date>(Date.class, sinceTime, untilTime));
View Full Code Here

        final List<FeatureTypeStats> stats = Lists.newArrayList();
        LogOp logOp = geogig.command(LogOp.class).setFirstParentOnly(true);
        final Iterator<RevCommit> log;
        if (since != null && !since.trim().isEmpty()) {
            Date untilTime = new Date();
            Date sinceTime = new Date(geogig.command(ParseTimestamp.class).setString(since).call());
            logOp.setTimeRange(new Range<Date>(Date.class, sinceTime, untilTime));
        }
        if (this.until != null) {
            Optional<ObjectId> until;
            until = geogig.command(RevParse.class).setRefSpec(this.until).call();
View Full Code Here

            Date sinceTime = new Date(geogig.command(ParseTimestamp.class).setString(since).call());
            logOp.setTimeRange(new Range<Date>(Date.class, sinceTime, untilTime));
        }
        if (this.until != null) {
            Optional<ObjectId> until;
            until = geogig.command(RevParse.class).setRefSpec(this.until).call();
            Preconditions.checkArgument(until.isPresent(), "Object not found '%s'", this.until);
            logOp.setUntil(until.get());
        }

        LsTreeOp lsTreeOp = geogig.command(LsTreeOp.class)
View Full Code Here

            until = geogig.command(RevParse.class).setRefSpec(this.until).call();
            Preconditions.checkArgument(until.isPresent(), "Object not found '%s'", this.until);
            logOp.setUntil(until.get());
        }

        LsTreeOp lsTreeOp = geogig.command(LsTreeOp.class)
                .setStrategy(LsTreeOp.Strategy.TREES_ONLY);
        if (path != null && !path.trim().isEmpty()) {
            lsTreeOp.setReference(path);
            logOp.addPath(path);
        }
View Full Code Here

        }
        int addedFeatures = 0;
        int modifiedFeatures = 0;
        int removedFeatures = 0;
        if (since != null && !since.trim().isEmpty() && firstCommit != null && lastCommit != null) {
            final Iterator<DiffEntry> diff = geogig.command(DiffOp.class)
                    .setOldVersion(firstCommit.getId()).setNewVersion(lastCommit.getId())
                    .setFilter(path).call();
            while (diff.hasNext()) {
                DiffEntry entry = diff.next();
                if (entry.changeType() == DiffEntry.ChangeType.ADDED) {
View Full Code Here

            }
        }

        final Context geogig = this.getCommandLocator(context);

        final Iterator<NodeRef> iter = geogig.command(LsTreeOp.class).setReference(ref)
                .setStrategy(lsStrategy).call();

        context.setResponseContent(new CommandResponse() {

            @Override
View Full Code Here

        odb = injector.objectDatabase();
        indexDb = injector.stagingDatabase();
        odb.open();
        indexDb.open();

        writeBack = injector.command(WriteBack.class);
    }

    @Test
    public void testSimple() {
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.