|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnl.toolforge.karma.core.vc.cvsimpl.CVSRunner
Runner class for CVS. Executes stuff on a CVS repository.
TODO : the CVSRunner could be made multi-threaded, to use bandwidth to a remote repository much better ...
Constructor Summary | |
CVSRunner(Location location)
Constructs a runner to fire commands on a CVS repository. |
Method Summary | |
void |
add(Module module,
java.io.File[] files,
java.io.File[] dirs)
Adds a set of files and/or a set of directories (recursively) to the version control system. |
void |
add(Module module,
java.lang.String[] files,
java.lang.String[] dirs)
See add(Module, File[], File[]) . |
void |
addModule(Module module,
java.lang.String comment)
|
void |
checkout(Module module)
Checks out a module from a version control system. |
void |
checkout(Module module,
DevelopmentLine developmentLine,
Version version)
See checkout(Module, Version) . |
void |
checkout(Module module,
Version version)
Performs the cvs checkout [-r <symbolic-name>] <module> command for a module. |
void |
commit(java.io.File file)
Commits file in the version control system. |
void |
createPatchLine(Module module)
Creates a patchline for the module, given the modules' current version. |
boolean |
existsInRepository(Module module)
A check if a module exists is done by trying to checkout the modules' module.info file in a temporary
location. |
boolean |
hasPatchLine(Module module)
Checks if the module has a CVS branch tag module.getPatchLine().getName() attached. |
org.netbeans.lib.cvsclient.command.log.LogInformation |
log(Module module)
Provide log information on a module. |
void |
promote(Module module,
java.lang.String comment,
Version version)
|
void |
setCommandResponse(CommandResponse response)
Assigns a CommandResponse instance to the runner to optionally promote interactivity. |
void |
update(Module module)
Updates an already checked out module. |
void |
update(Module module,
DevelopmentLine developmentLine,
Version version)
For a module, the cvs -q update -d -r <symbolic-name> command is executed. |
void |
update(Module module,
Version version)
Updates an already checked out module to a specified version . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CVSRunner(Location location) throws CVSException, AuthenticationException
CVSRunner
instance is
a Command
implementation, as that one knows what to fire away on CVS. The runner is instantiated with a
location
and a manifest
. The location must be a CVSLocationImpl
instance,
reprenting a CVS repository. The manifest is required because it determines the base point from where CVS commands
will be run; modules are checked out in a directory structure, relative to
Manifest.getModuleBaseDirectory()
.
location
- A Location
instance (typically a CVSLocationImpl
instance), containing
the location and connection details of the CVS repository.
CVSException
- AUTHENTICATION_ERROR
is thrown when location
cannot be authenticated.
AuthenticationException
- If the location cannot be authenticated.Method Detail |
public void setCommandResponse(CommandResponse response)
setCommandResponse
in interface Runner
response
- A - possibly null
response instance.public void commit(java.io.File file) throws VersionControlException
Runner
file
in the version control system. If file
is not yet under version control it
will be added.
commit
in interface Runner
VersionControlException
- Exceptions related to version control operations.public void addModule(Module module, java.lang.String comment) throws CVSException
addModule
in interface Runner
CVSException
public void checkout(Module module, Version version) throws CVSException
cvs checkout [-r <symbolic-name>] <module>
command for a module.
version
is used when not null
to checkout a module with a symbolic name.
checkout
in interface Runner
module
- The module to check out.version
- The version number for the module to check out.
CVSException
- With errorcodes NO_SUCH_MODULE_IN_REPOSITORY
when the module does not exist
in the repository and INVALID_SYMBOLIC_NAME
, when the version does not exists for the module.public void checkout(Module module) throws CVSException
Runner
checkout
in interface Runner
module
- The module that should be checked out of the version control repository.
CVSException
public void checkout(Module module, DevelopmentLine developmentLine, Version version) throws CVSException
checkout(Module, Version)
. This method defaults to the HEAD of the development branch at hand.
checkout
in interface Runner
module
- The module to check out.developmentLine
- The development line or null
when the TRUNK is the context line.version
- The version of the module that should be checked out.
CVSException
- With errorcodes NO_SUCH_MODULE_IN_REPOSITORY
when the module does not exist
in the repository and INVALID_SYMBOLIC_NAME
, when the version does not exists
for the module.public void update(Module module) throws CVSException
Runner
update
in interface Runner
module
- The module that should be updated.
CVSException
update(Module, DevelopmentLine, Version)
public void update(Module module, Version version) throws CVSException
Runner
version
.
update
in interface Runner
module
- The module that should be updated.version
- The version to which the the module should be updated,
CVSException
update(Module, DevelopmentLine, Version)
public void update(Module module, DevelopmentLine developmentLine, Version version) throws CVSException
cvs -q update -d -r <symbolic-name>
command is executed. Note that empty
directories are not pruned.
update
in interface Runner
module
- The module to update.developmentLine
- The development line or null
when the TRUNK is the context line.version
- The version of the module or null
when no specific version applies.
CVSException
public void add(Module module, java.io.File[] files, java.io.File[] dirs) throws CVSException
Runner
add
in interface Runner
module
- The module to which the files apply.files
- The filenames that should be added to the version control system repository.dirs
- The directory-paths that should be added to the version control system repository.
CVSException
public void add(Module module, java.lang.String[] files, java.lang.String[] dirs) throws CVSException
Runner
Runner.add(Module, File[], File[])
. This method converts the String
items to File
items.
add
in interface Runner
module
- The context module to which the files should be added.files
- Files to be added (each String
will be added relative to the module base directory).dirs
- Directories to be added (each String
will be added relative to the module base directory).
CVSException
public void promote(Module module, java.lang.String comment, Version version) throws CVSException
promote
in interface Runner
module
- comment
- Comment of the developerversion
-
CVSException
public org.netbeans.lib.cvsclient.command.log.LogInformation log(Module module) throws CVSException
setCommandResponse(nl.toolforge.karma.core.cmd.CommandResponse)
method has been called, which results in
this runner initializing the CVS API with the correct objects. This is a requirement for the Netbeans CVS API.
CVSException
public boolean hasPatchLine(Module module)
module.getPatchLine().getName()
attached.
hasPatchLine
in interface Runner
module
- The module for which the patch line should be checked.
true
of the module has a patch line attached in the CVS repository, false
otherwise.public void createPatchLine(Module module) throws CVSException
createPatchLine
in interface Runner
module
- The module.
CVSException
- When an error occurred during the creation process.public boolean existsInRepository(Module module)
module.info
file in a temporary
location. If that succeeds, apparently the module exists in that location and we have a true
to
return.
existsInRepository
in interface Runner
module
-
true
if the module exists, false
otherwise.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |