Package org.locationtech.geogig.api

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


            Form options = request.getResourceRef().getQueryAsForm();

            boolean remotes = Boolean.valueOf(options.getFirstValue("remotes", "false"));

            ImmutableList<Ref> refs = ggit.command(BranchListOp.class).setRemotes(remotes).call();
            ImmutableList<RevTag> tags = ggit.command(TagListOp.class).call();

            // Print out HEAD first
            final Ref currentHead = ggit.command(RefParse.class).setName(Ref.HEAD).call().get();
            if (!currentHead.getObjectId().equals(ObjectId.NULL)) {
View Full Code Here


            Form options = request.getResourceRef().getQueryAsForm();

            boolean remotes = Boolean.valueOf(options.getFirstValue("remotes", "false"));

            ImmutableList<Ref> refs = ggit.command(BranchListOp.class).setRemotes(remotes).call();
            ImmutableList<RevTag> tags = ggit.command(TagListOp.class).call();

            // Print out HEAD first
            final Ref currentHead = ggit.command(RefParse.class).setName(Ref.HEAD).call().get();
            if (!currentHead.getObjectId().equals(ObjectId.NULL)) {
                w.write(currentHead.getName() + " ");
View Full Code Here

            ImmutableList<Ref> refs = ggit.command(BranchListOp.class).setRemotes(remotes).call();
            ImmutableList<RevTag> tags = ggit.command(TagListOp.class).call();

            // Print out HEAD first
            final Ref currentHead = ggit.command(RefParse.class).setName(Ref.HEAD).call().get();
            if (!currentHead.getObjectId().equals(ObjectId.NULL)) {
                w.write(currentHead.getName() + " ");
                if (currentHead instanceof SymRef) {
                    w.write(((SymRef) currentHead).getTarget());
                }
View Full Code Here

                final ObjectId oid = ObjectId.valueOf(options.getFirstValue("objectId",
                        ObjectId.NULL.toString()));
                final ObjectId originalRefValue = ObjectId.valueOf(options.getFirstValue(
                        "originalRefValue", ObjectId.NULL.toString()));

                Optional<Ref> currentRef = geogig.command(RefParse.class).setName(refspec).call();
                ObjectId currentRefId = currentRef.isPresent() ? currentRef.get().getObjectId()
                        : ObjectId.NULL;
                if (!currentRefId.isNull() && !currentRefId.equals(originalRefValue)) {
                    // Abort push
                    w.write("Push aborted for address: " + ipAddress
View Full Code Here

            RevCommit revCommit = ggit.getRepository().getCommit(commitId);

            if (revCommit.getParentIds() != null && revCommit.getParentIds().size() > 0) {
                ObjectId parentId = revCommit.getParentIds().get(0);
                final Iterator<DiffEntry> diff = ggit.command(DiffOp.class).setOldVersion(parentId)
                        .setNewVersion(commitId).call();

                while (diff.hasNext()) {
                    DiffEntry diffEntry = diff.next();
                    if (diffEntry.getOldObject() != null) {
View Full Code Here

            }

            Request request = getRequest();
            final GeoGIG ggit = getGeogig(request).get();
            final Repository repository = ggit.getRepository();
            final Deduplicator deduplicator = ggit.command(CreateDeduplicator.class).call();

            BinaryPackedObjects packer = new BinaryPackedObjects(repository.stagingDatabase());
            Representation rep = new RevObjectBinaryRepresentation(packer, want, have, deduplicator);
            Response response = getResponse();
            response.setEntity(rep);
View Full Code Here

                if (conflict.has("ours") && conflict.get("ours").isJsonPrimitive()) {
                    String ourCommit = conflict.get("ours").getAsJsonPrimitive().getAsString();
                    Optional<NodeRef> ourNode = parseID(ObjectId.valueOf(ourCommit), featureId,
                            ggit);
                    if (ourNode.isPresent()) {
                        Optional<RevObject> object = ggit.command(RevObjectParse.class)
                                .setObjectId(ourNode.get().objectId()).call();
                        Preconditions.checkState(object.isPresent()
                                && object.get() instanceof RevFeature);

                        ourFeature = (RevFeature) object.get();
View Full Code Here

                        Preconditions.checkState(object.isPresent()
                                && object.get() instanceof RevFeature);

                        ourFeature = (RevFeature) object.get();

                        object = ggit.command(RevObjectParse.class)
                                .setObjectId(ourNode.get().getMetadataId()).call();
                        Preconditions.checkState(object.isPresent()
                                && object.get() instanceof RevFeatureType);

                        ourFeatureType = (RevFeatureType) object.get();
View Full Code Here

                if (conflict.has("theirs") && conflict.get("theirs").isJsonPrimitive()) {
                    String theirCommit = conflict.get("theirs").getAsJsonPrimitive().getAsString();
                    Optional<NodeRef> theirNode = parseID(ObjectId.valueOf(theirCommit), featureId,
                            ggit);
                    if (theirNode.isPresent()) {
                        Optional<RevObject> object = ggit.command(RevObjectParse.class)
                                .setObjectId(theirNode.get().objectId()).call();
                        Preconditions.checkState(object.isPresent()
                                && object.get() instanceof RevFeature);

                        theirFeature = (RevFeature) object.get();
View Full Code Here

                        Preconditions.checkState(object.isPresent()
                                && object.get() instanceof RevFeature);

                        theirFeature = (RevFeature) object.get();

                        object = ggit.command(RevObjectParse.class)
                                .setObjectId(theirNode.get().getMetadataId()).call();
                        Preconditions.checkState(object.isPresent()
                                && object.get() instanceof RevFeatureType);

                        theirFeatureType = (RevFeatureType) object.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.