Class ClientHelper

    • Method Detail

      • syncFiles

        public void syncFiles​(P4Ref buildChange,
                              Populate populate)
                       throws Exception
        Sync files to workspace at the specified change/label.
        Parameters:
        buildChange - Change to sync from
        populate - Populate strategy
        Throws:
        Exception - push up stack
      • tidyWorkspace

        public void tidyWorkspace​(Populate populate)
                           throws Exception
        Cleans up the Perforce workspace after a previous build. Removes all pending and abandoned files (equivalent to 'p4 revert -w').
        Parameters:
        populate - Jelly populate options
        Throws:
        Exception - push up stack
      • revertAllFiles

        public void revertAllFiles​(boolean virtual)
                            throws Exception
        Throws:
        Exception
      • unshelveFiles

        public void unshelveFiles​(long review)
                           throws Exception
        Unshelve review into workspace. Workspace is sync'ed to head first then review unshelved.
        Parameters:
        review - Review number (perhaps long?)
        Throws:
        Exception - push up stack
      • resolveFiles

        public void resolveFiles​(String mode)
                          throws Exception
        Resolve files in workspace with the specified option.
        Parameters:
        mode - Resolve mode
        Throws:
        Exception - push up stack
      • getChange

        public com.perforce.p4java.impl.generic.core.Changelist getChange​(long id)
                                                                   throws Exception
        Gets the Changelist (p4 describe -s); shouldn't need a client, but p4-java throws an exception if one is not set.
        Parameters:
        id - Change number (long perhaps)
        Returns:
        Perforce Changelist
        Throws:
        Exception - push up stack
      • getClientHead

        public long getClientHead​(P4Ref from,
                                  P4Ref to)
                           throws Exception
        Get the change number for the last change within the scope of the workspace view up to the specified revision
        Parameters:
        from - From revision (change or label)
        to - To revision (change or label)
        Returns:
        Perforce change
        Throws:
        Exception - push up stack
      • getClientHead

        public long getClientHead()
                           throws Exception
        Get the change number for the last change within the scope of the workspace view. If there are no recent changes use the latest change.
        Returns:
        Perforce change
        Throws:
        Exception - push up stack
      • getPendingChangelists

        public List<com.perforce.p4java.core.IChangelistSummary> getPendingChangelists​(boolean includeLongDescription,
                                                                                       String clientName)
                                                                                throws Exception
        Throws:
        Exception
      • listRepos

        public List<com.perforce.p4java.core.IRepo> listRepos()
        List of Graph Repos within the client's view
        Returns:
        A list of Graph Repos, empty list on error.
      • listChanges

        public List<P4Ref> listChanges​(List<P4Ref> fromRefs,
                                       P4Ref to)
                                throws Exception
        Show all changes within the scope of the client, between the 'from' and 'to' change limits.
        Parameters:
        fromRefs - list of from revisions (change or label)
        to - To revision (change or label)
        Returns:
        List of changes
        Throws:
        Exception - push up stack
      • listChanges

        public List<P4Ref> listChanges​(P4Ref from)
                                throws Exception
        Show all changes within the scope of the client, from the 'from' change limits.
        Parameters:
        from - From revision (change or label)
        Returns:
        List of changes
        Throws:
        Exception - push up stack
      • listChanges

        public List<P4Ref> listChanges()
                                throws Exception
        Show all changes within the scope of the client.
        Returns:
        List of changes
        Throws:
        Exception - push up stack
      • listHaveChanges

        public List<P4Ref> listHaveChanges​(List<P4Ref> fromRefs)
                                    throws Exception
        Fetches a list of changes needed to update the workspace to head.
        Parameters:
        fromRefs - List from revisions
        Returns:
        List of changes
        Throws:
        Exception - push up stack
      • listHaveChanges

        public List<P4Ref> listHaveChanges​(List<P4Ref> fromRefs,
                                           P4Ref changeLimit)
                                    throws Exception
        Fetches a list of changes needed to update the workspace to the specified limit. The limit could be a Perforce change number, label or counter.
        Parameters:
        fromRefs - List of from revisions
        changeLimit - To Revision
        Returns:
        List of changes
        Throws:
        Exception - push up stack
      • getClientView

        public com.perforce.p4java.impl.generic.client.ClientView getClientView()
      • isClientValid

        public boolean isClientValid​(Workspace workspace)
      • getClient

        public com.perforce.p4java.client.IClient getClient()