Package org.locationtech.geogig.api

Examples of org.locationtech.geogig.api.CommitBuilder


        index.put(s2);
        index.put(s3);
    }

    private static RevObject obj(String name) {
        RevCommit c = new CommitBuilder().setTreeId(ObjectId.NULL).setMessage(name).build();
        return c;
    }
View Full Code Here


    }

    private RevTree createHeadTree(NodeRef... treeRefs) {
        RevTree root = createFromRefs(objectDb, treeRefs);
        objectDb.put(root);
        CommitBuilder cb = new CommitBuilder(geogig.getPlatform());
        ObjectId treeId = root.getId();

        RevCommit commit = cb.setTreeId(treeId).setCommitter("Gabriel Roldan")
                .setAuthor("Gabriel Roldan").build();
        objectDb.put(commit);

        SymRef head = (SymRef) geogig.command(RefParse.class).setName(Ref.HEAD).call().get();
        final String currentBranch = head.getTarget();
View Full Code Here

        pointFeature1 = RevFeatureBuilder.build(points1);
        pointFeature2 = RevFeatureBuilder.build(points2);
        pointFeature1Duplicate = RevFeatureBuilder.build(points1);

        CommitBuilder b = new CommitBuilder();
        b.setAuthor("groldan");
        b.setAuthorEmail("groldan@boundlessgeo.com");
        b.setCommitter("jdeolive");
        b.setCommitterEmail("jdeolive@boundlessgeo.com");
        b.setMessage("cool this works");
        b.setCommitterTimestamp(1000);
        b.setCommitterTimeZoneOffset(5);

        ObjectId treeId = ObjectId.forString("fake tree content");

        b.setTreeId(treeId);

        ObjectId parentId1 = ObjectId.forString("fake parent content 1");
        ObjectId parentId2 = ObjectId.forString("fake parent content 2");
        List<ObjectId> parentIds = ImmutableList.of(parentId1, parentId2);
        b.setParentIds(parentIds);

        commit1 = b.build();
        commit1Duplicate = b.build();

        b.setMessage(null);
        b.setAuthor(null);
        b.setAuthorEmail(null);
        b.setCommitterTimestamp(-1000);
        b.setCommitterTimeZoneOffset(-5);
        b.setParentIds(ImmutableList.of(parentId1, ObjectId.NULL));

        commit2 = b.build();

        Object boolArray = new boolean[] { true, false, true, true, false };
        Object byteArray = new byte[] { 100, 127, -110, 26, 42 };
        Object charArray = new char[] { 'a', 'b', 'c', 'd', 'e' };
        Object doubleArray = new double[] { 1.5, 1.6, 1.7, 1.8 };
View Full Code Here

                .setAncestor(newTree.get().builder(geogig.stagingDatabase()))
                .setChildPath(node.get().getParentPath()).setToIndex(true)
                .setTree(treeBuilder.build()).setMetadataId(metadataId).call();

        // build new commit with parent of new commit and the newly built tree
        CommitBuilder builder = new CommitBuilder();

        builder.setParentIds(Lists.newArrayList(newCommitId));
        builder.setTreeId(newTreeId);
        builder.setAuthor(authorName.orNull());
        builder.setAuthorEmail(authorEmail.orNull());
        builder.setMessage(commitMessage.or("Reverted changes made to " + featurePath + " at "
                + newCommitId.toString()));

        RevCommit mapped = builder.build();
        context.getGeoGIG().getRepository().objectDatabase().put(mapped);

        // merge commit into current branch
        final Optional<Ref> currHead = geogig.command(RefParse.class).setName(Ref.HEAD).call();
        if (!currHead.isPresent()) {
View Full Code Here

TOP

Related Classes of org.locationtech.geogig.api.CommitBuilder

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.