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

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


     */
    @Override
    protected ObjectId _call() {
        final ProgressListener progress = getProgressListener();

        TreeDifference treeDifference = computeTreeDifference();

        if (treeDifference.areEqual()) {
            MutableTree leftTree = treeDifference.getLeftTree();
            Node leftNode = leftTree.getNode();
            ObjectId leftOid = leftNode.getObjectId();
            return leftOid;
        }

        final MutableTree oldLeftTree = treeDifference.getLeftTree().clone();
        Preconditions.checkState(oldLeftTree.equals(treeDifference.getLeftTree()));

        // handle renames before new and deleted trees for the computation of new and deleted to be
        // accurate
        Set<String> ignoreList = Sets.newHashSet();
        handleRenames(treeDifference, ignoreList);
        handlePureMetadataChanges(treeDifference, ignoreList);
        handleNewTrees(treeDifference, ignoreList);
        handleDeletedTrees(treeDifference, ignoreList);
        handleRemainingDifferences(treeDifference, ignoreList);

        progress.complete();

        MutableTree newLeftTree = treeDifference.getLeftTree();

        final ObjectDatabase repositoryDatabase = objectDatabase();
        final RevTree newRoot = newLeftTree.build(stagingDatabase(), repositoryDatabase);
        if (newRoot.trees().isPresent()) {
            for (Node n : newRoot.trees().get()) {
View Full Code Here


                Strategy.DEPTHFIRST_ONLY_TREES);

        MutableTree leftTree = MutableTree.createFromRefs(rootTreeId, leftTreeRefs);
        MutableTree rightTree = MutableTree.createFromRefs(stageRootId, rightTreeRefs);

        TreeDifference treeDifference = TreeDifference.create(leftTree, rightTree);
        return treeDifference;
    }
View Full Code Here

TOP

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

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.