org.apache.maven.scm.provider.perforce
Class PerforceScmProvider

java.lang.Object
  extended by org.apache.maven.scm.provider.AbstractScmProvider
      extended by org.apache.maven.scm.provider.perforce.PerforceScmProvider
All Implemented Interfaces:
ScmProvider

public class PerforceScmProvider
extends AbstractScmProvider

Version:
$Id: PerforceScmProvider.java 1306867 2012-03-29 13:45:10Z olamy $
Author:
Trygve Laugstøl , mperham
Plexus component:
role:
"org.apache.maven.scm.provider.ScmProvider"
role-hint:
"perforce"

Field Summary
static String DEFAULT_CLIENTSPEC_PROPERTY
           
 
Fields inherited from interface org.apache.maven.scm.provider.ScmProvider
ROLE
 
Constructor Summary
PerforceScmProvider()
           
 
Method Summary
 AddScmResult add(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params)
           
protected  BlameScmResult blame(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params)
           
protected  ChangeLogScmResult changelog(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)
          
protected  CheckInScmResult checkin(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params)
           
protected  CheckOutScmResult checkout(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params)
           
static String clean(String string)
           
static String createClientspec(ScmLogger logger, PerforceScmProviderRepository repo, File workDir, String repoPath)
           
static Commandline createP4Command(PerforceScmProviderRepository repo, File workingDir)
           
protected  DiffScmResult diff(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params)
           
protected  EditScmResult edit(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params)
           
static String getCanonicalRepoPath(String repoPath)
          Given a path like "//depot/foo/bar", returns the proper path to include everything beneath it.
static String getClientspecName(ScmLogger logger, PerforceScmProviderRepository repo, File workDir)
           
static String getRepoPath(ScmLogger log, PerforceScmProviderRepository repo, File basedir)
          This is a "safe" method which handles cases where repo.getPath() is not actually a valid Perforce depot location.
 String getScmType()
           
static boolean isLive()
           
protected  LoginScmResult login(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params)
           
 ScmProviderRepository makeProviderScmRepository(String scmSpecificUrl, char delimiter)
           
protected  RemoveScmResult remove(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params)
           
 boolean requiresEditMode()
          
protected  StatusScmResult status(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params)
           
protected  TagScmResult tag(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params)
           
protected  UnEditScmResult unedit(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params)
           
protected  UpdateScmResult update(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params)
           
 
Methods inherited from class org.apache.maven.scm.provider.AbstractScmProvider
add, add, add, addListener, blame, blame, branch, branch, branch, branch, changeLog, changeLog, changeLog, changeLog, changeLog, changeLog, changeLog, changeLog, changeLog, checkIn, checkIn, checkIn, checkOut, checkOut, checkOut, checkOut, checkOut, checkOut, diff, diff, edit, export, export, export, export, export, export, getLogger, getScmSpecificFilename, info, list, list, list, makeProviderScmRepository, mkdir, mkdir, remoteInfo, remove, sanitizeTagName, status, tag, tag, tag, unedit, update, update, update, update, update, update, update, update, update, update, update, update, validateScmUrl, validateTagName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CLIENTSPEC_PROPERTY

public static final String DEFAULT_CLIENTSPEC_PROPERTY
See Also:
Constant Field Values
Constructor Detail

PerforceScmProvider

public PerforceScmProvider()
Method Detail

requiresEditMode

public boolean requiresEditMode()
Description copied from class: AbstractScmProvider

Specified by:
requiresEditMode in interface ScmProvider
Overrides:
requiresEditMode in class AbstractScmProvider

makeProviderScmRepository

public ScmProviderRepository makeProviderScmRepository(String scmSpecificUrl,
                                                       char delimiter)
                                                throws ScmRepositoryException
Throws:
ScmRepositoryException

getScmType

public String getScmType()

changelog

protected ChangeLogScmResult changelog(ScmProviderRepository repository,
                                       ScmFileSet fileSet,
                                       CommandParameters parameters)
                                throws ScmException

Overrides:
changelog in class AbstractScmProvider
Throws:
ScmException

add

public AddScmResult add(ScmProviderRepository repository,
                        ScmFileSet fileSet,
                        CommandParameters params)
                 throws ScmException
Overrides:
add in class AbstractScmProvider
Throws:
ScmException

remove

protected RemoveScmResult remove(ScmProviderRepository repository,
                                 ScmFileSet fileSet,
                                 CommandParameters params)
                          throws ScmException
Overrides:
remove in class AbstractScmProvider
Throws:
ScmException

checkin

protected CheckInScmResult checkin(ScmProviderRepository repository,
                                   ScmFileSet fileSet,
                                   CommandParameters params)
                            throws ScmException
Overrides:
checkin in class AbstractScmProvider
Throws:
ScmException

checkout

protected CheckOutScmResult checkout(ScmProviderRepository repository,
                                     ScmFileSet fileSet,
                                     CommandParameters params)
                              throws ScmException
Overrides:
checkout in class AbstractScmProvider
Throws:
ScmException

diff

protected DiffScmResult diff(ScmProviderRepository repository,
                             ScmFileSet fileSet,
                             CommandParameters params)
                      throws ScmException
Overrides:
diff in class AbstractScmProvider
Throws:
ScmException

edit

protected EditScmResult edit(ScmProviderRepository repository,
                             ScmFileSet fileSet,
                             CommandParameters params)
                      throws ScmException
Overrides:
edit in class AbstractScmProvider
Throws:
ScmException

login

protected LoginScmResult login(ScmProviderRepository repository,
                               ScmFileSet fileSet,
                               CommandParameters params)
                        throws ScmException
Overrides:
login in class AbstractScmProvider
Throws:
ScmException

status

protected StatusScmResult status(ScmProviderRepository repository,
                                 ScmFileSet fileSet,
                                 CommandParameters params)
                          throws ScmException
Overrides:
status in class AbstractScmProvider
Throws:
ScmException

tag

protected TagScmResult tag(ScmProviderRepository repository,
                           ScmFileSet fileSet,
                           CommandParameters params)
                    throws ScmException
Overrides:
tag in class AbstractScmProvider
Throws:
ScmException

unedit

protected UnEditScmResult unedit(ScmProviderRepository repository,
                                 ScmFileSet fileSet,
                                 CommandParameters params)
                          throws ScmException
Overrides:
unedit in class AbstractScmProvider
Throws:
ScmException

update

protected UpdateScmResult update(ScmProviderRepository repository,
                                 ScmFileSet fileSet,
                                 CommandParameters params)
                          throws ScmException
Overrides:
update in class AbstractScmProvider
Throws:
ScmException

blame

protected BlameScmResult blame(ScmProviderRepository repository,
                               ScmFileSet fileSet,
                               CommandParameters params)
                        throws ScmException
Overrides:
blame in class AbstractScmProvider
Throws:
ScmException

createP4Command

public static Commandline createP4Command(PerforceScmProviderRepository repo,
                                          File workingDir)

clean

public static String clean(String string)

getCanonicalRepoPath

public static String getCanonicalRepoPath(String repoPath)
Given a path like "//depot/foo/bar", returns the proper path to include everything beneath it.

//depot/foo/bar -> //depot/foo/bar/... //depot/foo/bar/ -> //depot/foo/bar/... //depot/foo/bar/... -> //depot/foo/bar/...

Parameters:
repoPath -
Returns:

createClientspec

public static String createClientspec(ScmLogger logger,
                                      PerforceScmProviderRepository repo,
                                      File workDir,
                                      String repoPath)

getClientspecName

public static String getClientspecName(ScmLogger logger,
                                       PerforceScmProviderRepository repo,
                                       File workDir)

getRepoPath

public static String getRepoPath(ScmLogger log,
                                 PerforceScmProviderRepository repo,
                                 File basedir)
This is a "safe" method which handles cases where repo.getPath() is not actually a valid Perforce depot location. This is a frequent error due to branches and directory naming where dir name != artifactId.

Parameters:
log - the logging object to use
repo - the Perforce repo
basedir - the base directory we are operating in. If pom.xml exists in this directory, this method will verify
repo.getPath()/pom.xml
==
p4 where basedir/pom.xml
Returns:
repo.getPath if it is determined to be accurate. The p4 where location otherwise.

isLive

public static boolean isLive()


Copyright © 2003-2012 The Apache Software Foundation. All Rights Reserved.