Package org.locationtech.geogig.api

Examples of org.locationtech.geogig.api.RevPerson


            final Optional<Ref> currHead = command(RefParse.class).setName(Ref.HEAD).call();
            Preconditions.checkState(currHead.isPresent(),
                    "Repository has no HEAD, can't create tag");
            commitId = currHead.get().getObjectId();
        }
        RevPerson tagger = resolveTagger();
        message = message == null ? "" : message;
        RevTag tag = new RevTagImpl(ObjectId.NULL, name, commitId, message, tagger);
        ObjectId id = command(HashObject.class).setObject(tag).call();
        tag = new RevTagImpl(id, name, commitId, message, tagger);
        objectDatabase().put(tag);
View Full Code Here


    public static RevTag readTag(ObjectId id, DataInput in) throws IOException {
        final ObjectId commitId = readObjectId(in);
        final String name = in.readUTF();
        final String message = in.readUTF();
        final RevPerson tagger = readRevPerson(in);

        return new RevTagImpl(id, name, commitId, message, tagger);
    }
View Full Code Here

        for (int i = 0; i < nParents; i++) {
            ObjectId parentId = readObjectId(in);
            parentListBuilder.add(parentId);
        }
        final RevPerson author = readRevPerson(in);
        final RevPerson committer = readRevPerson(in);
        final String message = in.readUTF();

        return new RevCommitImpl(id, treeId, parentListBuilder.build(), author, committer, message);
    }
View Full Code Here

    public static RevTag readTag(ObjectId id, DataInput in) throws IOException {
        final ObjectId commitId = readObjectId(in);
        final String name = in.readUTF();
        final String message = in.readUTF();
        final RevPerson tagger = readRevPerson(in);

        return new RevTagImpl(id, name, commitId, message, tagger);
    }
View Full Code Here

        if (tag != COMMIT_AUTHOR_PREFIX) {
            throw new IllegalArgumentException(
                    "Expected AUTHOR element following parent ids in commit");
        }

        final RevPerson author = readRevPerson(in);

        tag = in.readByte();
        if (tag != COMMIT_COMMITTER_PREFIX) {
            throw new IllegalArgumentException(
                    "Expected COMMITTER element following author in commit");
        }

        final RevPerson committer = readRevPerson(in);

        final String message = in.readUTF();

        return new RevCommitImpl(id, treeId, parentListBuilder.build(), author, committer, message);
    }
View Full Code Here

            authors.add(lastCommit.getAuthor());
            totalCommits++;
        }
        while (log.hasNext()) {
            firstCommit = log.next();
            RevPerson newAuthor = firstCommit.getAuthor();
            // If the author isn't defined, use the committer for the purposes of statistics.
            if (!newAuthor.getName().isPresent() && !newAuthor.getEmail().isPresent()) {
                newAuthor = firstCommit.getCommitter();
            }
            if (newAuthor.getName().isPresent() || newAuthor.getEmail().isPresent()) {
                boolean authorFound = false;
                for (RevPerson author : authors) {
                    if (newAuthor.getName().equals(author.getName())
                            && newAuthor.getEmail().equals(author.getEmail())) {
                        authorFound = true;
                        break;
                    }
                }
                if (!authorFound) {
View Full Code Here

    }

    @Test
    public void testHashTags() throws Exception {

        RevPerson tagger = new RevPersonImpl("volaya", "volaya@boundlessgeo.com", -1000, -1);
        RevPerson tagger2 = new RevPersonImpl("groldan", "groldan@boundlessgeo.com", 10000, 0);
        RevTag tag = new RevTagImpl(null, "tag1", ObjectId.forString("fake commit id"), "message",
                tagger);
        RevTag tag2 = new RevTagImpl(null, "tag2", ObjectId.forString("another fake commit id"),
                "another message", tagger2);
        ObjectId tagId = hashCommand.setObject(tag).call();
View Full Code Here

TOP

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

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.