hudson.plugins.perforce
Class PerforceSCM

java.lang.Object
  extended by hudson.scm.SCM
      extended by hudson.plugins.perforce.PerforceSCM
All Implemented Interfaces:
hudson.ExtensionPoint, hudson.model.Describable<hudson.scm.SCM>

public class PerforceSCM
extends hudson.scm.SCM

Extends SCM to provide integration with Perforce SCM repositories.

Author:
Mike Wille, Brian Westrich, Victor Szoltysek

Nested Class Summary
static class PerforceSCM.PerforceSCMDescriptor
           
 
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
hudson.ExtensionPoint.LegacyInstancesAreScopedToHudson
 
Field Summary
 
Fields inherited from class hudson.scm.SCM
PERMISSIONS, TAG
 
Constructor Summary
PerforceSCM(String p4User, String p4Passwd, String p4Client, String p4Port, String projectOptions, String p4Tool, String p4SysRoot, String p4SysDrive, String p4Label, String p4Counter, String p4UpstreamProject, String lineEndValue, String p4Charset, String p4CommandCharset, String clientOwner, boolean updateCounterValue, boolean forceSync, boolean dontUpdateServer, boolean alwaysForceSync, boolean createWorkspace, boolean updateView, boolean disableAutoSync, boolean disableSyncOnly, boolean showIntegChanges, boolean dontUpdateClient, boolean exposeP4Passwd, boolean pollOnlyOnMaster, String slaveClientNameFormat, int firstChange, int fileLimit, PerforceRepositoryBrowser browser, String excludedUsers, String excludedFiles, boolean excludedFilesCaseSensitivity)
           
 
Method Summary
 void buildEnvVars(hudson.model.AbstractBuild<?,?> build, Map<String,String> env)
          Override of SCM.buildEnvVars() in order to setup the last change we have sync'd to as a Hudson environment variable: P4_CHANGELIST
 hudson.scm.SCMRevisionState calcRevisionsFromBuild(hudson.model.AbstractBuild<?,?> ab, hudson.Launcher lnchr, hudson.model.TaskListener tl)
          Part of the new polling routines.
 boolean checkout(hudson.model.AbstractBuild build, hudson.Launcher launcher, hudson.FilePath workspace, hudson.model.BuildListener listener, File changelogFile)
           
protected  hudson.scm.PollingResult compareRemoteRevisionWith(hudson.model.AbstractProject<?,?> project, hudson.Launcher launcher, hudson.FilePath workspace, hudson.model.TaskListener listener, hudson.scm.SCMRevisionState scmrs)
          Part of the new polling routines.
 hudson.scm.ChangeLogParser createChangeLogParser()
           
static boolean doesFilenameMatchP4Pattern(String filename, String patternString, boolean caseSensitive)
           
static String escapeP4String(String string)
           
 List<String> getAllLineEndChoices()
           
 PerforceRepositoryBrowser getBrowser()
           
 String getClientSpec()
           
 String getDecryptedP4Passwd()
           
 String getDecryptedP4Passwd(hudson.model.AbstractBuild build)
           
 String getDecryptedP4Passwd(hudson.model.AbstractProject project)
           
protected  Depot getDepot(hudson.Launcher launcher, hudson.FilePath workspace, hudson.model.AbstractProject project, hudson.model.AbstractBuild build, hudson.model.Node node)
          This only exists because we need to do initialization after we have been brought back to life.
 String getExcludedFiles()
           
 boolean getExcludedFilesCaseSensitivity()
           
 String getExcludedUsers()
           
 String getFileLimit()
          This is only for the config screen.
 String getFirstChange()
          This is only for the config screen.
 int getLastChange(hudson.model.Run build)
           
 String getLineEndValue()
           
 String getP4Charset()
           
 String getP4Client()
           
 String getP4CommandCharset()
           
 String getP4Counter()
           
 String getP4Exe()
          Deprecated. Replaced by getP4Tool()
 String getP4Executable(String tool)
          Get the path to p4 executable from a Perforce tool installation.
 String getP4Executable(String tool, hudson.model.Node node, hudson.model.TaskListener listener)
           
 String getP4Label()
           
 String getP4Passwd()
           
 String getP4Port()
           
 String getP4Stream()
          Get the stream name.
 String getP4SysDrive()
           
 String getP4SysRoot()
           
 String getP4Tool()
           
 PerforceToolInstallation getP4Tool(String tool)
          Get the path to p4 executable from a Perforce tool installation.
 String getP4UpstreamProject()
           
 String getP4User()
           
 String getProjectOptions()
          The current perforce option set for the view.
 String getProjectPath()
           
 String getSlaveClientNameFormat()
           
 String getViewMask()
           
 boolean isAlwaysForceSync()
           
 boolean isCleanWorkspaceBeforeBuild()
           
 boolean isCreateWorkspace()
           
 boolean isDisableAutoSync()
           
 boolean isDisableSyncOnly()
           
 boolean isDontRenameClient()
           
 boolean isDontUpdateClient()
           
 boolean isDontUpdateServer()
           
 boolean isExposeP4Passwd()
           
static boolean isFileInView(String filename, String projectPath, boolean caseSensitive)
           
 boolean isForceSync()
           
 boolean isPollOnlyOnMaster()
           
 boolean isQuickCleanBeforeBuild()
           
 boolean isRestoreChangedDeletedFiles()
           
 boolean isShowIntegChanges()
           
 boolean isSlaveClientNameStatic()
           
 boolean isUpdateCounterValue()
           
 boolean isUpdateView()
           
 boolean isUseClientSpec()
           
 boolean isUseLabel()
           
 boolean isUseOldClientName()
           
 boolean isUseStreamDepot()
          Check if we are using a stream depot type or a classic depot type.
 boolean isUseViewMask()
           
 boolean isUseViewMaskForPolling()
           
 boolean isUseViewMaskForSyncing()
           
 boolean isWipeBeforeBuild()
           
 boolean isWipeRepoBeforeBuild()
           
static List<String> parseProjectPath(String projectPath, String p4Client)
          Parses the projectPath into a list of pairs of strings representing the depot and client paths.
static List<String> parseProjectPath(String projectPath, String p4Client, PrintStream log)
           
static String processPathName(String path, boolean isUnix)
           
 boolean processWorkspaceBeforeDeletion(hudson.model.AbstractProject<?,?> project, hudson.FilePath workspace, hudson.model.Node node)
          With Perforce the server keeps track of files in the workspace.
 Object readResolve()
          Use the old job configuration data.
 boolean requiresWorkspaceForPolling()
           
 void setAlwaysForceSync(boolean force)
           
 void setClientSpec(String clientSpec)
           
 void setCreateWorkspace(boolean val)
           
 void setDisableAutoSync(boolean disable)
           
 void setDisableSyncOnly(boolean disableSyncOnly)
           
 void setDontRenameClient(boolean dontRenameClient)
           
 void setDontUpdateClient(boolean dontUpdateClient)
           
 void setDontUpdateServer(boolean dontUpdateServer)
           
 void setExcludedFiles(String files)
           
 void setExcludedFilesCaseSensitivity(boolean excludedFilesCaseSensitivity)
           
 void setExcludedUsers(String users)
           
 void setExposeP4Passwd(boolean exposeP4Passwd)
           
 void setFileLimit(int fileLimit)
           
 void setForceSync(boolean force)
           
 void setLineEndValue(String lineEndValue)
           
 void setP4Charset(String p4Charset)
           
 void setP4Client(String client)
           
 void setP4CommandCharset(String p4CommandCharset)
           
 void setP4Counter(String counter)
           
 void setP4Exe(String exe)
          Deprecated. Replaced by setP4Tool(String)
 void setP4Label(String label)
           
 void setP4Passwd(String passwd)
           
 void setP4Port(String port)
           
 void setP4Stream(String stream)
          Set the stream name.
 void setP4SysDrive(String sysDrive)
           
 void setP4SysRoot(String sysRoot)
           
 void setP4Tool(String tool)
           
 void setP4UpstreamProject(String project)
           
 void setP4User(String user)
           
 void setPollOnlyOnMaster(boolean pollOnlyOnMaster)
           
 void setProjectOptions(String projectOptions)
          Set the perforce options for view creation.
 void setProjectPath(String projectPath)
           
 void setQuickCleanBeforeBuild(boolean quickCleanBeforeBuild)
           
 void setRestoreChangedDeletedFiles(boolean restoreChangedDeletedFiles)
           
 void setShowIntegChanges(boolean showIntegChanges)
           
 void setSlaveClientNameFormat(String clientFormat)
           
 void setUpdateCounterValue(boolean updateCounterValue)
           
 void setUpdateView(boolean update)
           
 void setUseClientSpec(boolean useClientSpec)
           
 void setUseOldClientName(boolean use)
           
 void setUseStreamDepot(boolean useStreamDepot)
          Control the usage of stream depot.
 void setUseViewMask(boolean useViewMask)
           
 void setUseViewMaskForPolling(boolean useViewMaskForPolling)
           
 void setUseViewMaskForSyncing(boolean useViewMaskForSyncing)
           
 void setViewMask(String viewMask)
           
 void setWipeBeforeBuild(boolean wipeBeforeBuild)
           
 void setWipeRepoBeforeBuild(boolean wipeRepoBeforeBuild)
           
 boolean supportsPolling()
           
static String unescapeP4String(String string)
           
 
Methods inherited from class hudson.scm.SCM
_calcRevisionsFromBuild, _for, all, createEmptyChangeLog, getApi, getDescriptor, getEffectiveBrowser, getModuleRoot, getModuleRoot, getModuleRoots, getModuleRoots, getType, nullify, poll, pollChanges
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerforceSCM

@DataBoundConstructor
public PerforceSCM(String p4User,
                                        String p4Passwd,
                                        String p4Client,
                                        String p4Port,
                                        String projectOptions,
                                        String p4Tool,
                                        String p4SysRoot,
                                        String p4SysDrive,
                                        String p4Label,
                                        String p4Counter,
                                        String p4UpstreamProject,
                                        String lineEndValue,
                                        String p4Charset,
                                        String p4CommandCharset,
                                        String clientOwner,
                                        boolean updateCounterValue,
                                        boolean forceSync,
                                        boolean dontUpdateServer,
                                        boolean alwaysForceSync,
                                        boolean createWorkspace,
                                        boolean updateView,
                                        boolean disableAutoSync,
                                        boolean disableSyncOnly,
                                        boolean showIntegChanges,
                                        boolean dontUpdateClient,
                                        boolean exposeP4Passwd,
                                        boolean pollOnlyOnMaster,
                                        String slaveClientNameFormat,
                                        int firstChange,
                                        int fileLimit,
                                        PerforceRepositoryBrowser browser,
                                        String excludedUsers,
                                        String excludedFiles,
                                        boolean excludedFilesCaseSensitivity)
Method Detail

getDepot

protected Depot getDepot(hudson.Launcher launcher,
                         hudson.FilePath workspace,
                         hudson.model.AbstractProject project,
                         hudson.model.AbstractBuild build,
                         hudson.model.Node node)
This only exists because we need to do initialization after we have been brought back to life. I'm not quite clear on stapler and how all that works. At any rate, it doesn't look like we have an init() method for setting up our Depot after all of the setters have been called. Someone correct me if I'm wrong... UPDATE: With the addition of PerforceMailResolver, we now have need to share the depot object. I'm making this protected to enable that. Always create a new Depot to reflect any changes to the machines that P4 actions will be performed on.

Parameters:
node - the value of node

buildEnvVars

public void buildEnvVars(hudson.model.AbstractBuild<?,?> build,
                         Map<String,String> env)
Override of SCM.buildEnvVars() in order to setup the last change we have sync'd to as a Hudson environment variable: P4_CHANGELIST

Overrides:
buildEnvVars in class hudson.scm.SCM
Parameters:
build -
env -

getP4Executable

public String getP4Executable(String tool)
Get the path to p4 executable from a Perforce tool installation.

Parameters:
tool - the p4 tool installation name
Returns:
path to p4 tool path or an empty string if none is found

getP4Executable

public String getP4Executable(String tool,
                              hudson.model.Node node,
                              hudson.model.TaskListener listener)

getP4Tool

public PerforceToolInstallation getP4Tool(String tool)
Get the path to p4 executable from a Perforce tool installation.

Parameters:
tool - the p4 tool installation name
Returns:
path to p4 tool installation or null

readResolve

public Object readResolve()
Use the old job configuration data. This method is called after the object is read by XStream. We want to create tool installations for each individual "p4Exe" path as field "p4Exe" has been removed.

Returns:
the new object which is an instance of PerforceSCM

processPathName

public static String processPathName(String path,
                                     boolean isUnix)

isFileInView

public static boolean isFileInView(String filename,
                                   String projectPath,
                                   boolean caseSensitive)

checkout

public boolean checkout(hudson.model.AbstractBuild build,
                        hudson.Launcher launcher,
                        hudson.FilePath workspace,
                        hudson.model.BuildListener listener,
                        File changelogFile)
                 throws IOException,
                        InterruptedException
Specified by:
checkout in class hudson.scm.SCM
Throws:
IOException
InterruptedException

getBrowser

public PerforceRepositoryBrowser getBrowser()
Overrides:
getBrowser in class hudson.scm.SCM

createChangeLogParser

public hudson.scm.ChangeLogParser createChangeLogParser()
Specified by:
createChangeLogParser in class hudson.scm.SCM

calcRevisionsFromBuild

public hudson.scm.SCMRevisionState calcRevisionsFromBuild(hudson.model.AbstractBuild<?,?> ab,
                                                          hudson.Launcher lnchr,
                                                          hudson.model.TaskListener tl)
                                                   throws IOException,
                                                          InterruptedException
Part of the new polling routines. This determines the state of the build specified.

Specified by:
calcRevisionsFromBuild in class hudson.scm.SCM
Parameters:
ab -
lnchr -
tl -
Returns:
Throws:
IOException
InterruptedException

compareRemoteRevisionWith

protected hudson.scm.PollingResult compareRemoteRevisionWith(hudson.model.AbstractProject<?,?> project,
                                                             hudson.Launcher launcher,
                                                             hudson.FilePath workspace,
                                                             hudson.model.TaskListener listener,
                                                             hudson.scm.SCMRevisionState scmrs)
                                                      throws IOException,
                                                             InterruptedException
Part of the new polling routines. This compares the specified revision state with the repository, and returns a polling result.

Specified by:
compareRemoteRevisionWith in class hudson.scm.SCM
Parameters:
ap -
lnchr -
fp -
tl -
scmrs -
Returns:
Throws:
IOException
InterruptedException

doesFilenameMatchP4Pattern

public static boolean doesFilenameMatchP4Pattern(String filename,
                                                 String patternString,
                                                 boolean caseSensitive)
                                          throws PatternSyntaxException
Throws:
PatternSyntaxException

getLastChange

public int getLastChange(hudson.model.Run build)

getSlaveClientNameFormat

public String getSlaveClientNameFormat()

escapeP4String

public static String escapeP4String(String string)

unescapeP4String

public static String unescapeP4String(String string)

parseProjectPath

public static List<String> parseProjectPath(String projectPath,
                                            String p4Client)
Parses the projectPath into a list of pairs of strings representing the depot and client paths. Even items are depot and odd items are client.

This parser can handle quoted or non-quoted mappings, normal two-part mappings, or one-part mappings with an implied right part. It can also deal with +// or -// mapping forms.


parseProjectPath

public static List<String> parseProjectPath(String projectPath,
                                            String p4Client,
                                            PrintStream log)

getClientSpec

public String getClientSpec()
Returns:
the path to the ClientSpec

setClientSpec

public void setClientSpec(String clientSpec)
Parameters:
path - the path to the ClientSpec

isUseClientSpec

public boolean isUseClientSpec()
Returns:
True if we are using a ClientSpec file to setup the workspace view

setUseClientSpec

public void setUseClientSpec(boolean useClientSpec)
Parameters:
useClientSpec - True if a ClientSpec file should be used to setup workspace view, False otherwise

isUseStreamDepot

public boolean isUseStreamDepot()
Check if we are using a stream depot type or a classic depot type.

Returns:
True if we are using a stream depot type, False otherwise

setUseStreamDepot

public void setUseStreamDepot(boolean useStreamDepot)
Control the usage of stream depot.

Parameters:
useStreamDepot - True if stream depot is used, False otherwise

getP4Stream

public String getP4Stream()
Get the stream name.

Returns:
the p4Stream

setP4Stream

public void setP4Stream(String stream)
Set the stream name.

Parameters:
stream - the stream name

getProjectPath

public String getProjectPath()
Returns:
the projectPath

setProjectPath

public void setProjectPath(String projectPath)
Parameters:
projectPath - the projectPath to set

getP4User

public String getP4User()
Returns:
the p4User

setP4User

public void setP4User(String user)
Parameters:
user - the p4User to set

getP4Passwd

public String getP4Passwd()
Returns:
the p4Passwd

getDecryptedP4Passwd

public String getDecryptedP4Passwd()

getDecryptedP4Passwd

public String getDecryptedP4Passwd(hudson.model.AbstractBuild build)

getDecryptedP4Passwd

public String getDecryptedP4Passwd(hudson.model.AbstractProject project)

setP4Passwd

public void setP4Passwd(String passwd)
Parameters:
passwd - the p4Passwd to set

getP4Port

public String getP4Port()
Returns:
the p4Port

setP4Port

public void setP4Port(String port)
Parameters:
port - the p4Port to set

getP4Client

public String getP4Client()
Returns:
the p4Client

setP4Client

public void setP4Client(String client)
Parameters:
client - the p4Client to set

getP4SysDrive

public String getP4SysDrive()
Returns:
the p4SysDrive

setP4SysDrive

public void setP4SysDrive(String sysDrive)
Parameters:
sysDrive - the p4SysDrive to set

getP4SysRoot

public String getP4SysRoot()
Returns:
the p4SysRoot

setP4SysRoot

public void setP4SysRoot(String sysRoot)
Parameters:
sysRoot - the p4SysRoot to set

getP4Exe

public String getP4Exe()
Deprecated. Replaced by getP4Tool()


setP4Exe

public void setP4Exe(String exe)
Deprecated. Replaced by setP4Tool(String)


getP4Tool

public String getP4Tool()
Returns:
the p4Tool

setP4Tool

public void setP4Tool(String tool)
Parameters:
tool - the p4 tool installation to set

getP4Label

public String getP4Label()
Returns:
the p4Label

setP4Label

public void setP4Label(String label)
Parameters:
label - the p4Label to set

getP4Counter

public String getP4Counter()
Returns:
the p4Counter

setP4Counter

public void setP4Counter(String counter)
Parameters:
counter - the p4Counter to set

getP4UpstreamProject

public String getP4UpstreamProject()
Returns:
the p4UpstreamProject

setP4UpstreamProject

public void setP4UpstreamProject(String project)
Parameters:
label - the p4Label to set

isUpdateCounterValue

public boolean isUpdateCounterValue()
Returns:
True if the plugin should update the counter to the last change

setUpdateCounterValue

public void setUpdateCounterValue(boolean updateCounterValue)
Parameters:
updateCounterValue - True if the plugin should update the counter to the last change

isExposeP4Passwd

public boolean isExposeP4Passwd()
Returns:
True if the P4PASSWD value must be set in the environment

setExposeP4Passwd

public void setExposeP4Passwd(boolean exposeP4Passwd)
Parameters:
exposeP4Passwd - True if the P4PASSWD value must be set in the environment

getProjectOptions

public String getProjectOptions()
The current perforce option set for the view.

Returns:
current perforce view options

setProjectOptions

public void setProjectOptions(String projectOptions)
Set the perforce options for view creation.

Parameters:
projectOptions - the effective perforce options.

setCreateWorkspace

public void setCreateWorkspace(boolean val)
Parameters:
createWorkspace - True to let the plugin create the workspace, false to let the user manage it

isCreateWorkspace

public boolean isCreateWorkspace()
Returns:
True if the plugin manages the view, false if the user does.

setUpdateView

public void setUpdateView(boolean update)
Parameters:
update - True to let the plugin manage the view, false to let the user manage it

isUpdateView

public boolean isUpdateView()
Returns:
True if the plugin manages the view, false if the user does.

isForceSync

public boolean isForceSync()
Returns:
True if we are performing a one-time force sync

isAlwaysForceSync

public boolean isAlwaysForceSync()
Returns:
True if we are performing a one-time force sync

isDisableAutoSync

public boolean isDisableAutoSync()
Returns:
True if auto sync is disabled

isUseOldClientName

public boolean isUseOldClientName()
Returns:
True if we are using the old style client names

setForceSync

public void setForceSync(boolean force)
Parameters:
force - True to perform a one time force sync, false to perform normal sync

setAlwaysForceSync

public void setAlwaysForceSync(boolean force)
Parameters:
force - True to perform a one time force sync, false to perform normal sync

setDisableAutoSync

public void setDisableAutoSync(boolean disable)
Parameters:
disable - True to disable the pre-build sync, false to perform pre-build sync

setUseOldClientName

public void setUseOldClientName(boolean use)
Parameters:
use - True to use the old style client names, false to use the new style

isUseLabel

public boolean isUseLabel()
Returns:
True if we are using a label

setDontRenameClient

public void setDontRenameClient(boolean dontRenameClient)
Parameters:
dontRenameClient - False if the client will rename the client spec for each slave

isDontRenameClient

public boolean isDontRenameClient()
Returns:
True if the client will rename the client spec for each slave

isWipeBeforeBuild

public boolean isWipeBeforeBuild()
Returns:
True if the plugin is to delete the workpsace files before building.

isCleanWorkspaceBeforeBuild

public boolean isCleanWorkspaceBeforeBuild()
Returns:
True if the plugin is to clean the workspace using any method before building.

isWipeRepoBeforeBuild

public boolean isWipeRepoBeforeBuild()
Returns:
True if the plugin is to delete the workpsace including the.repository files before building.

setSlaveClientNameFormat

public void setSlaveClientNameFormat(String clientFormat)
Parameters:
clientFormat - A string defining the format of the client name for slave workspaces.

setWipeBeforeBuild

public void setWipeBeforeBuild(boolean wipeBeforeBuild)
Parameters:
wipeBeforeBuild - True if the client is to delete the workspace files before building.

setQuickCleanBeforeBuild

public void setQuickCleanBeforeBuild(boolean quickCleanBeforeBuild)

isDontUpdateClient

public boolean isDontUpdateClient()

setDontUpdateClient

public void setDontUpdateClient(boolean dontUpdateClient)

isUseViewMaskForPolling

public boolean isUseViewMaskForPolling()

setUseViewMaskForPolling

public void setUseViewMaskForPolling(boolean useViewMaskForPolling)

isUseViewMaskForSyncing

public boolean isUseViewMaskForSyncing()

setUseViewMaskForSyncing

public void setUseViewMaskForSyncing(boolean useViewMaskForSyncing)

getViewMask

public String getViewMask()

setViewMask

public void setViewMask(String viewMask)

isUseViewMask

public boolean isUseViewMask()

setUseViewMask

public void setUseViewMask(boolean useViewMask)

getP4Charset

public String getP4Charset()

setP4Charset

public void setP4Charset(String p4Charset)

getP4CommandCharset

public String getP4CommandCharset()

setP4CommandCharset

public void setP4CommandCharset(String p4CommandCharset)

getLineEndValue

public String getLineEndValue()

setLineEndValue

public void setLineEndValue(String lineEndValue)

isShowIntegChanges

public boolean isShowIntegChanges()

setShowIntegChanges

public void setShowIntegChanges(boolean showIntegChanges)

isDisableSyncOnly

public boolean isDisableSyncOnly()

setDisableSyncOnly

public void setDisableSyncOnly(boolean disableSyncOnly)

getExcludedUsers

public String getExcludedUsers()

setExcludedUsers

public void setExcludedUsers(String users)

getExcludedFiles

public String getExcludedFiles()

setExcludedFiles

public void setExcludedFiles(String files)

isPollOnlyOnMaster

public boolean isPollOnlyOnMaster()

setPollOnlyOnMaster

public void setPollOnlyOnMaster(boolean pollOnlyOnMaster)

isDontUpdateServer

public boolean isDontUpdateServer()

setDontUpdateServer

public void setDontUpdateServer(boolean dontUpdateServer)

getExcludedFilesCaseSensitivity

public boolean getExcludedFilesCaseSensitivity()

setExcludedFilesCaseSensitivity

public void setExcludedFilesCaseSensitivity(boolean excludedFilesCaseSensitivity)

setWipeRepoBeforeBuild

public void setWipeRepoBeforeBuild(boolean wipeRepoBeforeBuild)

isQuickCleanBeforeBuild

public boolean isQuickCleanBeforeBuild()

isRestoreChangedDeletedFiles

public boolean isRestoreChangedDeletedFiles()

setRestoreChangedDeletedFiles

public void setRestoreChangedDeletedFiles(boolean restoreChangedDeletedFiles)

getAllLineEndChoices

public List<String> getAllLineEndChoices()

getFirstChange

public String getFirstChange()
This is only for the config screen. Also, it returns a string and not an int. This is because we want to show an empty value in the config option if it is not being used. The default value of -1 is not exactly empty. So if we are set to default of -1, we return an empty string. Anything else and we return the actual change number.

Returns:
The one time use variable, firstChange.

getFileLimit

public String getFileLimit()
This is only for the config screen. Also, it returns a string and not an int. This is because we want to show an empty value in the config option if it is not being used. The default value of -1 is not exactly empty. So if we are set to default of -1, we return an empty string. Anything else and we return the actual change number.

Returns:
fileLimit

setFileLimit

public void setFileLimit(int fileLimit)

processWorkspaceBeforeDeletion

public boolean processWorkspaceBeforeDeletion(hudson.model.AbstractProject<?,?> project,
                                              hudson.FilePath workspace,
                                              hudson.model.Node node)
With Perforce the server keeps track of files in the workspace. We never want files deleted without the knowledge of the server so we disable the cleanup process.

Overrides:
processWorkspaceBeforeDeletion in class hudson.scm.SCM
Parameters:
project - The project that owns this SCM. This is always the same object for a particular instanceof SCM. Just passed in here so that SCM itself doesn't have to remember the value.
workspace - The workspace which is about to be deleted. Never null. This can be a remote file path.
node - The node that hosts the workspace. SCM can use this information to determine the course of action.
Returns:
true if SCM is OK to let Hudson proceed with deleting the workspace. False to veto the workspace deletion.

requiresWorkspaceForPolling

public boolean requiresWorkspaceForPolling()
Overrides:
requiresWorkspaceForPolling in class hudson.scm.SCM

isSlaveClientNameStatic

public boolean isSlaveClientNameStatic()

supportsPolling

public boolean supportsPolling()
Overrides:
supportsPolling in class hudson.scm.SCM


Copyright © 2004-2013 Hudson. All Rights Reserved.