Package hudson.scm

Class AbstractCvs

java.lang.Object
hudson.scm.SCM
hudson.scm.AbstractCvs
All Implemented Interfaces:
ExtensionPoint, Describable<SCM>, ICvs, Serializable
Direct Known Subclasses:
CvsProjectset, CVSSCM

public abstract class AbstractCvs extends SCM implements ICvs
See Also:
  • Field Details

    • DATE_FORMATTER

      protected static final DateFormat DATE_FORMATTER
  • Constructor Details

    • AbstractCvs

      public AbstractCvs()
  • Method Details

    • getDescriptor

      public AbstractCvsDescriptor getDescriptor()
      Description copied from interface: ICvs
      Gets the descriptor for the current plugin.
      Specified by:
      getDescriptor in interface Describable<SCM>
      Specified by:
      getDescriptor in interface ICvs
      Overrides:
      getDescriptor in class SCM
      Returns:
      the current descriptor
      See Also:
    • isCheckoutCurrentTimestamp

      public boolean isCheckoutCurrentTimestamp()
    • checkout

      protected boolean checkout(CvsRepository[] repositories, boolean isFlatten, FilePath workspace, boolean canUseUpdate, Run<?,?> build, String dateStamp, boolean pruneEmptyDirectories, boolean cleanOnFailedUpdate, TaskListener listener) throws IOException, InterruptedException
      Throws:
      IOException
      InterruptedException
    • getCvsClient

      public org.netbeans.lib.cvsclient.Client getCvsClient(CvsRepository repository, EnvVars envVars, TaskListener listener)
      Gets an instance of the CVS client that can be used for connection to a repository. If the repository specifies a password then the client's connection will be set with this password.
      Parameters:
      repository - the repository to connect to
      envVars - variables to use for macro expansion
      Returns:
      a CVS client capable of connecting to the specified repository
    • getCvsClient

      public org.netbeans.lib.cvsclient.Client getCvsClient(CvsRepository repository, EnvVars envVars, TaskListener listener, boolean showAuthenticationInfo)
      Gets an instance of the CVS client that can be used for connection to a repository. If the repository specifies a password then the client's connection will be set with this password.
      Parameters:
      repository - the repository to connect to
      envVars - variables to use for macro expansion
      showAuthenticationInfo - whether to log where the authentication details are being obtanied from
      Returns:
      a CVS client capable of connecting to the specified repository
    • getGlobalOptions

      public org.netbeans.lib.cvsclient.command.GlobalOptions getGlobalOptions(CvsRepository repository, EnvVars envVars)
    • isDisableCvsQuiet

      public boolean isDisableCvsQuiet()
      Description copied from interface: ICvs
      CVS is normally run in quiet mode to reduce un-needed log output. This option allows plugins to stop quiet mode being enabled.
      Specified by:
      isDisableCvsQuiet in interface ICvs
      Returns:
      whether to disable quiet mode or not.
    • calcRevisionsFromBuild

      public SCMRevisionState calcRevisionsFromBuild(AbstractBuild<?,?> build, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
      Since we add the current SCMRevisionState as an action during the build (so we can get the current workspace state), this method should never be called. Just for safety, we get the action and return it.
      Overrides:
      calcRevisionsFromBuild in class SCM
      Throws:
      IOException
      InterruptedException
      See Also:
    • calcRevisionsFromBuild

      @CheckForNull public SCMRevisionState calcRevisionsFromBuild(@NonNull Run<?,?> build, @Nullable FilePath workspace, @Nullable Launcher launcher, @NonNull TaskListener listener) throws IOException, InterruptedException
      Overrides:
      calcRevisionsFromBuild in class SCM
      Throws:
      IOException
      InterruptedException
    • compareRemoteRevisionWith

      protected PollingResult compareRemoteRevisionWith(AbstractProject<?,?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline, CvsRepository[] repositories) throws IOException, InterruptedException
      Throws:
      IOException
      InterruptedException
    • calculateRepositoryState

      protected List<CvsFile> calculateRepositoryState(Date startTime, Date endTime, CvsRepository repository, TaskListener listener, EnvVars envVars, FilePath workspace) throws IOException, InterruptedException
      Builds a list of files that have changed in the given repository between any 2 time-stamps. This does not require the workspace to be checked out and does not change the state of any checked out workspace. The list returned does not have any filters set for exclude regions (i.e. it's every file that's changed for the modules being watched).
      Parameters:
      startTime - the time-stamp to start filtering changes from
      endTime - the time-stamp to end filtering changes from
      repository - the repository to search for changes in. All modules under this repository will be checked
      listener - where to send log output
      envVars - the environmental variables to perform parameter expansion from
      Returns:
      a list of changed files, including their versions and change comments
      Throws:
      IOException - on communication failure (e.g. communication with slaves)
      InterruptedException
    • calculateChangeLog

      protected List<CVSChangeLogSet.CVSChangeLog> calculateChangeLog(Date startTime, Date endTime, CvsRepository repository, TaskListener listener, EnvVars envVars, FilePath workspace) throws IOException, InterruptedException
      Builds a list of changes that have occurred in the given repository between any 2 time-stamps. This does not require the workspace to be checked out and does not change the state of any checked out workspace. The list returned does not have any filters set for exclude regions (i.e. it's every file that's changed for the modules being watched).
      Parameters:
      startTime - the time-stamp to start filtering changes from
      endTime - the time-stamp to end filtering changes from
      repository - the repository to search for changes in. All modules under this repository will be checked
      listener - where to send log output
      envVars - the environmental variables to perform parameter expansion from.
      Returns:
      a list of changed files, including their versions and change comments
      Throws:
      IOException - on communication failure (e.g. communication with slaves)
      InterruptedException - on job cancellation
    • postCheckout

      protected void postCheckout(Run<?,?> build, File changelogFile, CvsRepository[] repositories, FilePath workspace, TaskListener listener, boolean flatten, EnvVars envVars) throws IOException, InterruptedException
      Throws:
      IOException
      InterruptedException
    • getCheckoutDate

      protected Date getCheckoutDate(Run<?,?> build)
    • isSymLink

      public static boolean isSymLink(File file, TaskListener listener)
      Check if the given file is a symbolic link. Useful for preventing CSV recursing into directories infinitely.
      Parameters:
      file - name of the file to test
      Returns:
      whether the file if believed to be a symlink or not
    • createChangeLogParser

      public ChangeLogParser createChangeLogParser()
      Specified by:
      createChangeLogParser in class SCM