Package org.locationtech.geogig.api.plumbing.diff

Examples of org.locationtech.geogig.api.plumbing.diff.FeatureDiff


            final NodeRef oldObject = diffEntry.getOldObject();
            if (diffEntry.changeType() == ChangeType.MODIFIED) {
                RevObject revObject = command(RevObjectParse.class)
                        .setObjectId(diffEntry.newObjectId()).call().get();
                if (revObject instanceof RevFeature) {
                    FeatureDiff diff = command(DiffFeature.class)
                            .setNewVersion(Suppliers.ofInstance(diffEntry.getNewObject()))
                            .setOldVersion(Suppliers.ofInstance(diffEntry.getOldObject())).call();
                    patch.addModifiedFeature(diff);
                } else if (revObject instanceof RevTree) {
                    RevFeatureType oldFeatureType = command(RevObjectParse.class)
View Full Code Here


                        RevFeature feature = revObjectParse.setRefSpec(refSpec)
                                .call(RevFeature.class).get();
                        report.setFirstVersion(feature, commit);
                        break;
                    }
                    FeatureDiff featureDiff = diffFeature
                            .setNewVersion(Suppliers.ofInstance(diff.getNewObject()))
                            .setOldVersion(Suppliers.ofInstance(diff.getOldObject())).call();
                    Map<PropertyDescriptor, AttributeDiff> attribDiffs = featureDiff.getDiffs();
                    Iterator<PropertyDescriptor> iter = attribDiffs.keySet().iterator();
                    while (iter.hasNext()) {
                        PropertyDescriptor key = iter.next();
                        Optional<?> value = attribDiffs.get(key).getNewValue();
                        String attribute = key.getName().toString();
View Full Code Here

        String path = NodeRef.appendChild(pointsName, points1.getIdentifier().getID());
        Map<PropertyDescriptor, AttributeDiff> map = Maps.newHashMap();
        Optional<?> oldValue = Optional.fromNullable(points1.getProperty("sp").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(oldValue, Optional.of("new"));
        map.put(pointsType.getDescriptor("sp"), diff);
        FeatureDiff feaureDiff = new FeatureDiff(path, map, RevFeatureTypeImpl.build(pointsType),
                RevFeatureTypeImpl.build(pointsType));
        patch.addModifiedFeature(feaureDiff);
        File file = new File(platform.pwd(), "test.patch");
        BufferedWriter writer = Files.newWriter(file, Charsets.UTF_8);
        PatchSerializer.write(writer, patch);
View Full Code Here

            if (describe) {
                sb.append(diffEntry.changeType().toString().charAt(0)).append(' ').append(path)
                        .append(LINE_BREAK);

                if (diffEntry.changeType() == ChangeType.MODIFIED) {
                    FeatureDiff featureDiff = geogig.command(DiffFeature.class)
                            .setNewVersion(Suppliers.ofInstance(diffEntry.getNewObject()))
                            .setOldVersion(Suppliers.ofInstance(diffEntry.getOldObject())).call();
                    Map<PropertyDescriptor, AttributeDiff> diffs = featureDiff.getDiffs();
                    HashSet<PropertyDescriptor> diffDescriptors = Sets.newHashSet(diffs.keySet());
                    NodeRef noderef = diffEntry.changeType() != ChangeType.REMOVED ? diffEntry
                            .getNewObject() : diffEntry.getOldObject();
                    RevFeatureType featureType = geogig.command(RevObjectParse.class)
                            .setObjectId(noderef.getMetadataId()).call(RevFeatureType.class).get();
View Full Code Here

        if (!noHeader) {
            summaryPrinter.print(geogig, console, diffEntry);
        }

        if (diffEntry.changeType() == ChangeType.MODIFIED) {
            FeatureDiff diff = geogig.command(DiffFeature.class)
                    .setNewVersion(Suppliers.ofInstance(diffEntry.getNewObject()))
                    .setOldVersion(Suppliers.ofInstance(diffEntry.getOldObject())).call();

            Map<PropertyDescriptor, AttributeDiff> diffs = diff.getDiffs();

            Ansi ansi = AnsiDecorator.newAnsi(console.getTerminal().isAnsiSupported());
            Set<Entry<PropertyDescriptor, AttributeDiff>> entries = diffs.entrySet();
            Iterator<Entry<PropertyDescriptor, AttributeDiff>> iter = entries.iterator();
            while (iter.hasNext()) {
View Full Code Here

    }

    private FeatureDiff compare(RevFeature oldRevFeature, RevFeature newRevFeature,
            RevFeatureType oldRevFeatureType, RevFeatureType newRevFeatureType) {

        return new FeatureDiff(oldNodeRef.path(), newRevFeature, oldRevFeature, newRevFeatureType,
                oldRevFeatureType, false);
    }
View Full Code Here

                            .find(this.workingTree().getTree(), path);
                    RevFeatureType featureType = command(RevObjectParse.class)
                            .setObjectId(noderef.get().getMetadataId()).call(RevFeatureType.class)
                            .get();
                    ImmutableList<PropertyDescriptor> descriptors = featureType.sortedDescriptors();
                    FeatureDiff featureDiff = command(DiffFeature.class)
                            .setOldVersion(Suppliers.ofInstance(diff.getOldObject()))
                            .setNewVersion(Suppliers.ofInstance(diff.getNewObject())).call();
                    Set<Entry<PropertyDescriptor, AttributeDiff>> attrDiffs = featureDiff
                            .getDiffs().entrySet();
                    RevFeature newFeature = command(RevObjectParse.class)
                            .setObjectId(diff.newObjectId()).call(RevFeature.class).get();
                    boolean ok = true;
                    for (Iterator<Entry<PropertyDescriptor, AttributeDiff>> iterator = attrDiffs
View Full Code Here

                            ours = mergeIntoDiff.getNewObject().getMetadataId();
                            theirs = toMergeDiff.getNewObject().getMetadataId();
                            report.addConflict(new Conflict(path, ancestorVersionId, ours, theirs));
                        }
                    } else {
                        FeatureDiff toMergeFeatureDiff = command(DiffFeature.class)
                                .setOldVersion(Suppliers.ofInstance(toMergeDiff.getOldObject()))
                                .setNewVersion(Suppliers.ofInstance(toMergeDiff.getNewObject()))
                                .call();
                        FeatureDiff mergeIntoFeatureDiff = command(DiffFeature.class)
                                .setOldVersion(Suppliers.ofInstance(mergeIntoDiff.getOldObject()))
                                .setNewVersion(Suppliers.ofInstance(mergeIntoDiff.getNewObject()))
                                .call();
                        if (toMergeFeatureDiff.conflicts(mergeIntoFeatureDiff)) {
                            report.addConflict(new Conflict(path, ancestorVersionId, ours, theirs));
View Full Code Here

        String path = NodeRef.appendChild(pointsName, points1.getIdentifier().getID());
        Map<PropertyDescriptor, AttributeDiff> map = Maps.newHashMap();
        Optional<?> oldValue = Optional.fromNullable(points1.getProperty("sp").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(oldValue, Optional.of("new"));
        map.put(pointsType.getDescriptor("sp"), diff);
        FeatureDiff feaureDiff = new FeatureDiff(path, map, RevFeatureTypeImpl.build(pointsType),
                RevFeatureTypeImpl.build(pointsType));
        patch.addModifiedFeature(feaureDiff);
        geogig.command(ApplyPatchOp.class).setPatch(patch).call();
        RevTree root = repo.workingTree().getTree();
        Optional<Node> featureBlobId = findTreeChild(root, path);
View Full Code Here

        String path = NodeRef.appendChild(pointsName, points1.getIdentifier().getID());
        Map<PropertyDescriptor, AttributeDiff> map = Maps.newHashMap();
        Optional<?> oldValue = Optional.fromNullable(points1.getProperty("sp").getValue());
        GenericAttributeDiffImpl diff = new GenericAttributeDiffImpl(oldValue, Optional.of("new"));
        map.put(pointsType.getDescriptor("sp"), diff);
        FeatureDiff feaureDiff = new FeatureDiff(path, map, RevFeatureTypeImpl.build(pointsType),
                RevFeatureTypeImpl.build(pointsType));
        patch.addModifiedFeature(feaureDiff);
        try {
            geogig.command(ApplyPatchOp.class).setPatch(patch).call();
            fail();
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.plumbing.diff.FeatureDiff

Copyright © 2018 www.massapicom. 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.