Class AbstractGitScmProvider
- java.lang.Object
-
- org.apache.maven.scm.provider.AbstractScmProvider
-
- org.apache.maven.scm.provider.git.AbstractGitScmProvider
-
- All Implemented Interfaces:
ScmProvider
- Direct Known Subclasses:
GitExeScmProvider,JGitScmProvider
public abstract class AbstractGitScmProvider extends AbstractScmProvider
SCM Provider for git.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classAbstractGitScmProvider.ScmUrlParserResultInternal class.
-
Field Summary
-
Fields inherited from class org.apache.maven.scm.provider.AbstractScmProvider
logger
-
-
Constructor Summary
Constructors Constructor Description AbstractGitScmProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description AddScmResultadd(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)TODO: why public? This should be protected, no?protected BlameScmResultblame(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)protected BranchScmResultbranch(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)ChangeLogScmResultchangelog(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)CheckInScmResultcheckin(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)CheckInScmResultcheckIn(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters)Save the changes you have done into the repository.CheckOutScmResultcheckout(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)DiffScmResultdiff(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)protected ScmResultexecuteCommand(GitCommand command, ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)protected ExportScmResultexport(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)protected abstract GitCommandgetAddCommand()protected abstract GitCommandgetBlameCommand()protected abstract GitCommandgetBranchCommand()protected abstract GitCommandgetChangeLogCommand()protected abstract GitCommandgetCheckInCommand()protected abstract GitCommandgetCheckOutCommand()protected abstract GitCommandgetDiffCommand()protected abstract GitCommandgetExportCommand()protected abstract GitCommandgetInfoCommand()protected abstract GitCommandgetRemoteInfoCommand()protected abstract GitCommandgetRemoveCommand()protected abstract java.lang.StringgetRepositoryURL(java.io.File path)java.lang.StringgetScmSpecificFilename()Returns the scm reserved file name where the SCM stores information like '.git', '.svn'.java.lang.StringgetScmType()protected abstract GitCommandgetStatusCommand()protected abstract GitCommandgetTagCommand()protected abstract GitCommandgetUntagCommand()protected abstract GitCommandgetUpdateCommand()InfoScmResultinfo(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)ScmProviderRepositorymakeProviderScmRepository(java.io.File path)Try to create aScmProviderRepositoryfor this provider from the given working directory (created through a previous checkout).ScmProviderRepositorymakeProviderScmRepository(java.lang.String scmSpecificUrl, char delimiter)private AbstractGitScmProvider.ScmUrlParserResultparseScmUrl(java.lang.String scmSpecificUrl, char delimiter)The git-submodule(1) command is available since Git 1.5.3, so modules will be activated in a later stage.RemoteInfoScmResultremoteInfo(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)RemoveScmResultremove(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)StatusScmResultstatus(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)TagScmResulttag(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)UntagScmResultuntag(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters)Deletes a tag.UpdateScmResultupdate(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters)java.util.List<java.lang.String>validateScmUrl(java.lang.String scmSpecificUrl, char delimiter)Validate the scm url.-
Methods inherited from class org.apache.maven.scm.provider.AbstractScmProvider
add, add, add, blame, blame, branch, branch, branch, changeLog, changeLog, changeLog, changeLog, changeLog, changeLog, changeLog, changeLog, changeLog, checkIn, checkIn, checkIn, checkOut, checkOut, checkOut, checkOut, checkOut, checkOut, checkOut, diff, diff, edit, edit, export, export, export, export, export, list, list, list, login, mkdir, mkdir, remove, requiresEditMode, sanitizeTagName, status, tag, tag, tag, unedit, unedit, update, update, update, update, update, update, update, update, update, update, update, update, validateTagName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.maven.scm.provider.ScmProvider
setInteractive
-
-
-
-
Method Detail
-
getScmSpecificFilename
public java.lang.String getScmSpecificFilename()
Returns the scm reserved file name where the SCM stores information like '.git', '.svn'.- Specified by:
getScmSpecificFilenamein interfaceScmProvider- Overrides:
getScmSpecificFilenamein classAbstractScmProvider- Returns:
- the scm reserved file name
-
makeProviderScmRepository
public ScmProviderRepository makeProviderScmRepository(java.lang.String scmSpecificUrl, char delimiter) throws ScmRepositoryException
- Throws:
ScmRepositoryException
-
makeProviderScmRepository
public ScmProviderRepository makeProviderScmRepository(java.io.File path) throws ScmRepositoryException, UnknownRepositoryStructure
Try to create aScmProviderRepositoryfor this provider from the given working directory (created through a previous checkout). This is only successful if the working directory is recognized by this SCM provider.- Specified by:
makeProviderScmRepositoryin interfaceScmProvider- Overrides:
makeProviderScmRepositoryin classAbstractScmProvider- Parameters:
path- the checkout(working) directory- Returns:
- the repository bound to this provider
- Throws:
ScmRepositoryException- in case the given directory does not contain a valid working directory recognized by this providerUnknownRepositoryStructure- in case the provider does not support this way of initializing an ScmProviderRepository
-
getRepositoryURL
protected abstract java.lang.String getRepositoryURL(java.io.File path) throws ScmException- Throws:
ScmException
-
validateScmUrl
public java.util.List<java.lang.String> validateScmUrl(java.lang.String scmSpecificUrl, char delimiter)Validate the scm url.- Specified by:
validateScmUrlin interfaceScmProvider- Overrides:
validateScmUrlin classAbstractScmProvider- Parameters:
scmSpecificUrl- the SCM urldelimiter- the delimiter used in the SCM url- Returns:
- returns a list of messages if the validation failed
-
getScmType
public java.lang.String getScmType()
-
parseScmUrl
private AbstractGitScmProvider.ScmUrlParserResult parseScmUrl(java.lang.String scmSpecificUrl, char delimiter) throws ScmException
The git-submodule(1) command is available since Git 1.5.3, so modules will be activated in a later stage.- Throws:
ScmException
-
getAddCommand
protected abstract GitCommand getAddCommand()
-
add
public AddScmResult add(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
TODO: why public? This should be protected, no?- Overrides:
addin classAbstractScmProvider- Throws:
ScmException
-
getBranchCommand
protected abstract GitCommand getBranchCommand()
-
branch
protected BranchScmResult branch(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
- Overrides:
branchin classAbstractScmProvider- Throws:
ScmException
-
getChangeLogCommand
protected abstract GitCommand getChangeLogCommand()
-
changelog
public ChangeLogScmResult changelog(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
- Overrides:
changelogin classAbstractScmProvider- Throws:
ScmException
-
getCheckInCommand
protected abstract GitCommand getCheckInCommand()
-
checkin
public CheckInScmResult checkin(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
- Overrides:
checkinin classAbstractScmProvider- Throws:
ScmException
-
checkIn
public CheckInScmResult checkIn(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
Description copied from interface:ScmProviderSave the changes you have done into the repository. This will create a new version of the file or directory in the repository.When the fileSet has no entries, the fileSet.getBaseDir() is recursively committed. When the fileSet has entries, the commit is non-recursive and only the elements in the fileSet are committed.
- Specified by:
checkInin interfaceScmProvider- Overrides:
checkInin classAbstractScmProvider- Parameters:
repository- the source control systemfileSet- the files to check in (sometimes called commit)parameters-CommandParameters- Returns:
- TODO
- Throws:
ScmException- if any
-
getCheckOutCommand
protected abstract GitCommand getCheckOutCommand()
-
checkout
public CheckOutScmResult checkout(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
- Overrides:
checkoutin classAbstractScmProvider- Throws:
ScmException
-
getDiffCommand
protected abstract GitCommand getDiffCommand()
-
diff
public DiffScmResult diff(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
- Overrides:
diffin classAbstractScmProvider- Throws:
ScmException
-
getExportCommand
protected abstract GitCommand getExportCommand()
-
export
protected ExportScmResult export(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
- Overrides:
exportin classAbstractScmProvider- Throws:
ScmException
-
getRemoveCommand
protected abstract GitCommand getRemoveCommand()
-
remove
public RemoveScmResult remove(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
- Overrides:
removein classAbstractScmProvider- Throws:
ScmException
-
getStatusCommand
protected abstract GitCommand getStatusCommand()
-
status
public StatusScmResult status(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
- Overrides:
statusin classAbstractScmProvider- Throws:
ScmException
-
getTagCommand
protected abstract GitCommand getTagCommand()
-
tag
public TagScmResult tag(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
- Overrides:
tagin classAbstractScmProvider- Throws:
ScmException
-
getUntagCommand
protected abstract GitCommand getUntagCommand()
-
untag
public UntagScmResult untag(ScmRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
Deletes a tag.- Specified by:
untagin interfaceScmProvider- Overrides:
untagin classAbstractScmProvider- Parameters:
repository- the source control systemfileSet- a fileset with the relevant working directory as basedirparameters- TODO- Returns:
- TODO
- Throws:
ScmException- if any
-
getUpdateCommand
protected abstract GitCommand getUpdateCommand()
-
update
public UpdateScmResult update(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
- Overrides:
updatein classAbstractScmProvider- Throws:
ScmException
-
executeCommand
protected ScmResult executeCommand(GitCommand command, ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
- Throws:
ScmException
-
getInfoCommand
protected abstract GitCommand getInfoCommand()
-
info
public InfoScmResult info(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
- Specified by:
infoin interfaceScmProvider- Overrides:
infoin classAbstractScmProvider- Parameters:
repository- the source control systemfileSet- location of your local copyparameters- some parameters (not use currently but for future use)- Returns:
- if the scm implementation doesn't support "info" result will
null - Throws:
ScmException- if any
-
blame
protected BlameScmResult blame(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
- Overrides:
blamein classAbstractScmProvider- Throws:
ScmException
-
getBlameCommand
protected abstract GitCommand getBlameCommand()
-
remoteInfo
public RemoteInfoScmResult remoteInfo(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException
- Specified by:
remoteInfoin interfaceScmProvider- Overrides:
remoteInfoin classAbstractScmProvider- Parameters:
repository- the source control systemfileSet- not use currently but for future useparameters- some parameters (not use currently but for future use)- Returns:
- if the scm implementation doesn't support "info" result will
null - Throws:
ScmException- if any
-
getRemoteInfoCommand
protected abstract GitCommand getRemoteInfoCommand()
-
-