Class TestRepository.CommitBuilder

  • Enclosing class:
    TestRepository<R extends Repository>

    public class TestRepository.CommitBuilder
    extends java.lang.Object
    Helper to generate a commit.
    • Method Detail

      • parent

        public TestRepository.CommitBuilder parent​(RevCommit p)
                                            throws java.lang.Exception
        set parent commit
        Parameters:
        p - parent commit
        Returns:
        this commit builder
        Throws:
        java.lang.Exception
      • parents

        public java.util.List<RevCommit> parents()
        Get parent commits
        Returns:
        parent commits
      • setTopLevelTree

        public TestRepository.CommitBuilder setTopLevelTree​(ObjectId treeId)
        Set top level tree
        Parameters:
        treeId - the top level tree
        Returns:
        this commit builder
      • add

        public TestRepository.CommitBuilder add​(java.lang.String path,
                                                java.lang.String content)
                                         throws java.lang.Exception
        Add file with given content
        Parameters:
        path - path of the file
        content - the file content
        Returns:
        this commit builder
        Throws:
        java.lang.Exception
      • add

        public TestRepository.CommitBuilder add​(java.lang.String path,
                                                RevBlob id)
                                         throws java.lang.Exception
        Add file with given path and blob
        Parameters:
        path - path of the file
        id - blob for this file
        Returns:
        this commit builder
        Throws:
        java.lang.Exception
      • rm

        public TestRepository.CommitBuilder rm​(java.lang.String path)
        Remove a file
        Parameters:
        path - path of the file
        Returns:
        this commit builder
      • message

        public TestRepository.CommitBuilder message​(java.lang.String m)
        Set commit message
        Parameters:
        m - the message
        Returns:
        this commit builder
      • message

        public java.lang.String message()
        Get the commit message
        Returns:
        the commit message
      • tick

        public TestRepository.CommitBuilder tick​(int secs)
        Tick the clock
        Parameters:
        secs - number of seconds
        Returns:
        this commit builder
      • author

        public PersonIdent author()
        Get the author identity
        Returns:
        the author identity
      • committer

        public PersonIdent committer()
        Get the committer identity
        Returns:
        the committer identity
      • insertChangeId

        public TestRepository.CommitBuilder insertChangeId​(java.lang.String c)
        Insert given changeId
        Parameters:
        c - changeId
        Returns:
        this commit builder
      • create

        public RevCommit create()
                         throws java.lang.Exception
        Create the commit
        Returns:
        the new commit
        Throws:
        java.lang.Exception - if creation failed
      • insertChangeId

        private void insertChangeId​(CommitBuilder c)
      • child

        public TestRepository.CommitBuilder child()
                                           throws java.lang.Exception
        Create child commit builder
        Returns:
        child commit builder
        Throws:
        java.lang.Exception