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 691810 2008-09-03 22:38:28Z vsiveton $
Author:
Trygve Laugstøl , mperham

Field Summary
static java.lang.String DEFAULT_CLIENTSPEC_PROPERTY
           
 
Fields inherited from interface org.apache.maven.scm.provider.ScmProvider
ROLE
 
Constructor Summary
PerforceScmProvider()
           
 
Method Summary
protected  AddScmResult add(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 java.lang.String clean(java.lang.String string)
           
static java.lang.String createClientspec(ScmLogger logger, PerforceScmProviderRepository repo, java.io.File workDir, java.lang.String repoPath)
           
static org.codehaus.plexus.util.cli.Commandline createP4Command(PerforceScmProviderRepository repo, java.io.File workingDir)
           
protected  DiffScmResult diff(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params)
           
protected  EditScmResult edit(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params)
           
static java.lang.String getCanonicalRepoPath(java.lang.String repoPath)
          Given a path like "//depot/foo/bar", returns the proper path to include everything beneath it.
static java.lang.String getClientspecName(ScmLogger logger, PerforceScmProviderRepository repo, java.io.File workDir)
           
static java.lang.String getRepoPath(ScmLogger log, PerforceScmProviderRepository repo, java.io.File basedir)
          This is a "safe" method which handles cases where repo.getPath() is not actually a valid Perforce depot location.
 java.lang.String getScmType()
           
static boolean isLive()
           
protected  LoginScmResult login(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params)
           
 ScmProviderRepository makeProviderScmRepository(java.lang.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, addListener, branch, branch, branch, 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, list, list, list, makeProviderScmRepository, 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 java.lang.String DEFAULT_CLIENTSPEC_PROPERTY
See Also:
Constant Field Values
Constructor Detail

PerforceScmProvider

public PerforceScmProvider()
Method Detail

requiresEditMode

public boolean requiresEditMode()
Specified by:
requiresEditMode in interface ScmProvider
Overrides:
requiresEditMode in class AbstractScmProvider

makeProviderScmRepository

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

getScmType

public java.lang.String getScmType()

changelog

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

Overrides:
changelog in class AbstractScmProvider
Throws:
ScmException

add

protected 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

createP4Command

public static org.codehaus.plexus.util.cli.Commandline createP4Command(PerforceScmProviderRepository repo,
                                                                       java.io.File workingDir)

clean

public static java.lang.String clean(java.lang.String string)

getCanonicalRepoPath

public static java.lang.String getCanonicalRepoPath(java.lang.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 java.lang.String createClientspec(ScmLogger logger,
                                                PerforceScmProviderRepository repo,
                                                java.io.File workDir,
                                                java.lang.String repoPath)

getClientspecName

public static java.lang.String getClientspecName(ScmLogger logger,
                                                 PerforceScmProviderRepository repo,
                                                 java.io.File workDir)

getRepoPath

public static java.lang.String getRepoPath(ScmLogger log,
                                           PerforceScmProviderRepository repo,
                                           java.io.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-2011 Apache Software Foundation. All Rights Reserved.