Package org.locationtech.geogig.repository

Examples of org.locationtech.geogig.repository.StagingArea


            // assertEquals(NodeRef.ROOT, unstaged.get(0).newName());
            assertEquals(emptyTreeName, unstaged.get(0).newName());
        }
        geogig.command(AddOp.class).call();
        {
            StagingArea index = geogig.getRepository().index();
            List<DiffEntry> staged = toList(index.getStaged(null));
            assertEquals(staged.toString(), 1, staged.size());
            // assertEquals(NodeRef.ROOT, staged.get(0).newName());
            assertEquals(emptyTreeName, staged.get(0).newName());
        }
        CommitOp commitCommand = geogig.command(CommitOp.class);
View Full Code Here


        }

        final Way way = (Way) primitive;
        final ImmutableList<Long> nodes = way.getNodes();

        StagingArea index = geogig.getRepository().index();

        FeatureBuilder featureBuilder = new FeatureBuilder(NODE_REV_TYPE);
        List<Coordinate> coordinates = Lists.newArrayList(nodes.size());
        FindTreeChild findTreeChild = geogig.command(FindTreeChild.class);
        findTreeChild.setIndex(true);
        ObjectId rootTreeId = geogig.command(ResolveTreeish.class).setTreeish(Ref.HEAD).call()
                .get();
        if (!rootTreeId.isNull()) {
            RevTree headTree = geogig.command(RevObjectParse.class).setObjectId(rootTreeId)
                    .call(RevTree.class).get();
            findTreeChild.setParent(headTree);
        }
        for (Long nodeId : nodes) {
            Coordinate coord = thisChangePointCache.get(nodeId);
            if (coord == null) {
                String fid = String.valueOf(nodeId);
                String path = NodeRef.appendChild(NODE_TYPE_NAME, fid);
                Optional<org.locationtech.geogig.api.Node> ref = index.findStaged(path);
                if (!ref.isPresent()) {
                    Optional<NodeRef> nodeRef = findTreeChild.setChildPath(path).call();
                    if (nodeRef.isPresent()) {
                        ref = Optional.of(nodeRef.get().getNode());
                    } else {
                        ref = Optional.absent();
                    }
                }
                if (ref.isPresent()) {
                    org.locationtech.geogig.api.Node nodeRef = ref.get();

                    RevFeature revFeature = index.getDatabase().getFeature(nodeRef.getObjectId());
                    String id = NodeRef.nodeFromPath(nodeRef.getName());
                    Feature feature = featureBuilder.build(id, revFeature);

                    Point p = (Point) ((SimpleFeature) feature).getAttribute("location");
                    if (p != null) {
View Full Code Here

    }

    @Override
    protected StatusSummary _call() {
        WorkingTree workTree = workingTree();
        StagingArea index = index();

        StatusSummary summary = new StatusSummary();

        summary.countStaged = index.countStaged(null).count();
        summary.countUnstaged = workTree.countUnstaged(null).count();
        summary.countConflicted = index.countConflicted(null);

        if (summary.countStaged > 0) {
            summary.staged = command(DiffIndex.class).setReportTrees(true);
        }
        if (summary.countUnstaged > 0) {
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.repository.StagingArea

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.