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

Examples of org.locationtech.geogig.api.plumbing.diff.DiffEntry.oldObjectId()


        assertNotNull(de.getNewObject());

        assertEquals(linesName, de.newPath());

        assertEquals(DiffEntry.ChangeType.ADDED, de.changeType());
        assertEquals(ObjectId.NULL, de.oldObjectId());
        assertFalse(de.getNewObject().getMetadataId().isNull());
    }

    @Test
    public void testReportTrees() throws Exception {
View Full Code Here


                        patch.addFeatureType(featureType);
                    }
                }
            } else if (diffEntry.changeType() == ChangeType.REMOVED) {
                RevObject revObject = command(RevObjectParse.class)
                        .setObjectId(diffEntry.oldObjectId()).call().get();
                if (revObject instanceof RevFeature) {
                    RevFeatureType featureType;
                    if (featureTypes.containsKey(oldObject.getMetadataId())) {
                        featureType = featureTypes.get(oldObject.getMetadataId());
                    } else {
View Full Code Here

                                .get();
                        featureTypes.put(oldObject.getMetadataId(), featureType);
                    }

                    FeatureBuilder featureBuilder = new FeatureBuilder(featureType);
                    Feature feature = featureBuilder.build(diffEntry.oldObjectId().toString(),
                            (RevFeature) revObject);
                    String name = diffEntry.oldPath();
                    patch.addRemovedFeature(name, feature, featureType);
                } else if (revObject instanceof RevTree) {
                    ObjectId metadataId = diffEntry.getOldObject().getMetadataId();
View Full Code Here

                while (diff.hasNext()) {
                    diffEntry = diff.next();
                    String path = diffEntry.newPath() != null ? diffEntry.newPath() : diffEntry
                            .oldPath();
                    sb.append('\t').append(path).append(' ')
                            .append(diffEntry.oldObjectId().toString()).append(' ')
                            .append(diffEntry.newObjectId().toString()).append('\n');
                }
            }
            console.println(sb.toString());
        }
View Full Code Here

                }
            }

            else {
                sb.append(path).append(' ');
                sb.append(diffEntry.oldObjectId().toString());
                sb.append(' ');
                sb.append(diffEntry.newObjectId().toString());
                cli.getConsole().println(sb.toString());
            }
View Full Code Here

                    report.addUnconflicted(diff);
                }
                break;
            case REMOVED:
                if (obj.isPresent()) {
                    if (obj.get().getId().equals(diff.oldObjectId())) {
                        report.addUnconflicted(diff);
                    } else {
                        report.addConflict(new Conflict(path, diff.oldObjectId(), ObjectId.NULL,
                                obj.get().getId()));
                    }
View Full Code Here

            case REMOVED:
                if (obj.isPresent()) {
                    if (obj.get().getId().equals(diff.oldObjectId())) {
                        report.addUnconflicted(diff);
                    } else {
                        report.addConflict(new Conflict(path, diff.oldObjectId(), ObjectId.NULL,
                                obj.get().getId()));
                    }
                }
                break;
            case MODIFIED:
View Full Code Here

                        }
                    }
                    if (ok) {
                        report.addUnconflicted(diff);
                    } else {
                        report.addConflict(new Conflict(path, diff.oldObjectId(), diff
                                .newObjectId(), obj.get().getId()));
                    }
                }

                break;
View Full Code Here

                // Feature was deleted
                Optional<NodeRef> node = command(FindTreeChild.class).setChildPath(diff.newPath())
                        .setIndex(true).setParent(headTree).call();
                // make sure it is still deleted
                if (node.isPresent()) {
                    conflicts.add(new Conflict(diff.newPath(), diff.oldObjectId(), node.get()
                            .objectId(), diff.newObjectId()));
                } else {
                    index().stage(getProgressListener(), Iterators.singletonIterator(diff), 1);
                }
            } else {
View Full Code Here

                // Feature was added or modified
                Optional<NodeRef> node = command(FindTreeChild.class).setChildPath(diff.oldPath())
                        .setIndex(true).setParent(headTree).call();
                ObjectId nodeId = node.get().getNode().getObjectId();
                // Make sure it wasn't changed
                if (node.isPresent() && nodeId.equals(diff.oldObjectId())) {
                    index().stage(getProgressListener(), Iterators.singletonIterator(diff), 1);
                } else {
                    // do not mark as conflict if reverting to the same feature currently in HEAD
                    if (!nodeId.equals(diff.newObjectId())) {
                        conflicts.add(new Conflict(diff.newPath(), diff.oldObjectId(), node.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.