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

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


            }
            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());
                }
            }
        } else {
            geogig.command(CleanOp.class).setPath(pathFilter).call();
View Full Code Here


        Iterator<DiffEntry> indexDiffs = this.geogigTx.command(DiffIndex.class).call();
        int added = 0, removed = 0, modified = 0;
        StringBuilder msg = new StringBuilder();
        while (indexDiffs.hasNext()) {
            DiffEntry entry = indexDiffs.next();
            switch (entry.changeType()) {
            case ADDED:
                added++;
                break;
            case MODIFIED:
                modified++;
View Full Code Here

            case REMOVED:
                removed++;
                break;
            }
            if ((added + removed + modified) < 10) {
                msg.append("\n ").append(entry.changeType().toString().toLowerCase()).append(' ')
                        .append(entry.newPath() == null ? entry.oldName() : entry.newPath());
            }
        }
        int count = added + removed + modified;
        if (count > 10) {
View Full Code Here

            if (ref == null) {
                ref = diff.getOldObject();
            }

            final String parentPath = ref.getParentPath();
            final boolean isDelete = ChangeType.REMOVED.equals(diff.changeType());
            final TYPE type = ref.getType();
            if (isDelete && deletedTrees.contains(parentPath)) {
                // this is to avoid re-creating the parentTree for a feature delete after its parent
                // tree delete entry was processed
                continue;
View Full Code Here

        while (diffs.hasNext()) {
            DiffEntry diff = diffs.next();
            String path = diff.oldPath() == null ? diff.newPath() : diff.oldPath();
            Optional<RevObject> obj = command(RevObjectParse.class).setRefSpec(
                    Ref.HEAD + ":" + path).call();
            switch (diff.changeType()) {
            case ADDED:
                if (obj.isPresent()) {
                    TYPE type = command(ResolveObjectType.class).setObjectId(
                            diff.getNewObject().objectId()).call();
                    if (TYPE.TREE.equals(type)) {
View Full Code Here

                ObjectId theirs = toMergeDiff.getNewObject() == null ? ObjectId.NULL : toMergeDiff
                        .getNewObject().objectId();
                DiffEntry mergeIntoDiff = mergeIntoDiffs.get(path);
                ObjectId ours = mergeIntoDiff.getNewObject() == null ? ObjectId.NULL
                        : mergeIntoDiff.getNewObject().objectId();
                if (!mergeIntoDiff.changeType().equals(toMergeDiff.changeType())) {
                    report.addConflict(new Conflict(path, ancestorVersionId, ours, theirs));
                    continue;
                }
                switch (toMergeDiff.changeType()) {
                case ADDED:
View Full Code Here

                if (diffs.containsKey(path)) {
                    diffs.get(path).add(diff);
                } else {
                    diffs.put(path, Lists.newArrayList(diff));
                }
                if (ChangeType.REMOVED.equals(diff.changeType())) {
                    removedPaths.add(path);
                }
            }
        }
View Full Code Here

                    .setNewTree(workingTree().getTree().getId())
                    .setOldTree(entry.get().getPostMappingId()).call();

            while (diffs.hasNext()) {
                DiffEntry diff = diffs.next();
                if (diff.changeType().equals(DiffEntry.ChangeType.REMOVED)) {

                    ObjectId featureId = diff.getOldObject().getNode().getObjectId();
                    RevFeature revFeature = command(RevObjectParse.class).setObjectId(featureId)
                            .call(RevFeature.class).get();
                    RevFeatureType revFeatureType = command(RevObjectParse.class)
View Full Code Here

                Iterator<DiffEntry> unstaged = geogig.command(DiffWorkTree.class).setFilter(null)
                        .call();
                cli.getConsole().println("Unstaged changes after reset:");
                while (unstaged.hasNext()) {
                    DiffEntry entry = unstaged.next();
                    ChangeType type = entry.changeType();
                    switch (type) {
                    case ADDED:
                        cli.getConsole().println("A\t" + entry.newPath());
                        break;
                    case MODIFIED:
View Full Code Here

        int adds = 0, deletes = 0, changes = 0;
        DiffEntry diffEntry;
        while (diff.hasNext()) {
            diffEntry = diff.next();
            switch (diffEntry.changeType()) {
            case ADDED:
                ++adds;
                break;
            case REMOVED:
                ++deletes;
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.