Package fr.ifremer.isisfish.vcs
Class VCSSVN
java.lang.Object
fr.ifremer.isisfish.vcs.AbstractVCS
fr.ifremer.isisfish.vcs.VCSSVN
- All Implemented Interfaces:
VCS
,FileFilter
SVN VCS.
Based on SVNKit.
- Version:
- $Revision$ Last update : $Date$ By : $Author$
- Author:
- poussin
-
Nested Class Summary
Nested classes/interfaces inherited from interface fr.ifremer.isisfish.vcs.VCS
VCS.Status
-
Field Summary
Modifier and TypeFieldDescriptionprotected VCSSVN.ConnectionState
Current connection state.protected static org.apache.commons.logging.Log
to use log facility, just put in your code: log.info(\"...\");protected org.tmatesoft.svn.core.wc.SVNClientManager
Svn client manager instance.Fields inherited from class fr.ifremer.isisfish.vcs.AbstractVCS
host, listeners, localRepository, login, password, path, protocol, sshKeyFile, writeable
Fields inherited from interface fr.ifremer.isisfish.vcs.VCS
TYPE_CVS, TYPE_NONE, TYPE_SVN, VCS_HOST_NAME, VCS_PATH, VCS_PROTOCOL, VCS_TYPE, VCS_USER_NAME, VCS_USER_PASSWORD
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Perform : - svn add - commitVérifie si tous les fichiers du repository local sont les dernieres version par rapport au serveur.void
checkout
(org.nuiton.version.Version tag, boolean recurse) get repository on server and put it in localdir.void
Verifie la connexion et si le protocole a change, switch le repository pour utiliser le nouveau protocole.void
Cleanup a directory, removing all lock.void
Commit specified files, if files is null, all files are committed.protected void
commitWithoutCheck
(List<File> files, String msg) Commit without ask for registred listeners.void
Delete and commit files in server repository.getChanglog
(List<File> files) Return all changelog between local file version and remote repository file version.show diff between local file and repository file.getFileList
(File directory) Return list of all file on directory on remote server.getLocalStatus
(File file) Get file local status.getLocalStatus
(File file, boolean recurse, org.tmatesoft.svn.core.wc.SVNStatusType... wanted) Recherche le statut des fichiers locaux, ne retourne jamais les fichiers NORMAL ou NONE sauf si demandé explicitement via wantedRetourne l'url du repository distant.getRemoteStatus
(File file, boolean recurse) Retourne la liste des fichiers qui ont été mis à jour sur le serveur.protected org.tmatesoft.svn.core.SVNURL
Retourne l'url dans un objet SVNURL (svnkit).protected org.tmatesoft.svn.core.wc.SVNClientManager
Return svnkit SVNManager.getTag()
Retourne le tag reellement utilise, par exemple si on a fait un setTag(3.2.0) cette methode retourne "/tags/3.2.0", pour setTag(null) on retourne "/trunk"get list of new or modified files on server.boolean
Ask if there are some new or modified files on server.boolean
Get connection state.boolean
isOnRemote
(File file) Check if file is available on server.boolean
isTag
(org.nuiton.version.Version version) Look on server if version is tag repository.boolean
isUpToDate
(File file) Check if file is uptodate.boolean
Return true, if local repository is valid repository for actual vcs.boolean
isVersionnableFile
(File file) Check if file can be put in vcs repository.boolean
Return true, if local repository is writable.setTag
(org.nuiton.version.Version version) Change repository tag, used when we use some tag and we want to go to trunk.Update file.Methods inherited from class fr.ifremer.isisfish.vcs.AbstractVCS
accept, addVetoableActionListener, fireAction, getHost, getLocalRepository, getLogin, getPassword, getPath, getProtocol, getSshKeyFile, remoteVetoableActionListener, setHost, setLocalRepository, setLogin, setPassword, setPath, setProtocol, setSshKeyFile, setWriteable
-
Field Details
-
log
protected static org.apache.commons.logging.Log logto use log facility, just put in your code: log.info(\"...\"); -
svnManager
protected org.tmatesoft.svn.core.wc.SVNClientManager svnManagerSvn client manager instance. -
connectionState
Current connection state.
-
-
Constructor Details
-
Method Details
-
getSVNManager
protected org.tmatesoft.svn.core.wc.SVNClientManager getSVNManager()Return svnkit SVNManager.- Returns:
- SVNManager instance
- See Also:
-
SVNClientManager
-
isValidLocalRepository
public boolean isValidLocalRepository()Return true, if local repository is valid repository for actual vcs.- Returns:
- validity
-
isConnected
public boolean isConnected()Get connection state.- Returns:
- true if server is connected
-
checkProtocol
Verifie la connexion et si le protocole a change, switch le repository pour utiliser le nouveau protocole. Si on est en mode interface (mode graphique) et que le switch se passe mal, demande a l'utilisateur de nouvelle valeur pour le protocole (+ identifiant, ...)- Throws:
VCSException
-
checkFileStatus
Vérifie si tous les fichiers du repository local sont les dernieres version par rapport au serveur. Si ce n'est pas le cas et que l'on est en mode interactif (mode graphique), on lui propose de mettre a jour les fichiers, avec la possibilite de voir les changements sur les fichiers- Returns:
- list of file with unresolved conflict
- Throws:
VCSException
-
getRemoteURL
protected org.tmatesoft.svn.core.SVNURL getRemoteURL() throws org.tmatesoft.svn.core.SVNExceptionRetourne l'url dans un objet SVNURL (svnkit).- Returns:
- l'url distante
- Throws:
org.tmatesoft.svn.core.SVNException
- See Also:
-
SVNURL
-
getRemoteRepository
Retourne l'url du repository distant. ex: ssh+svn://labs.le.org/svnroot/isis-fish/data/branches/3.2- Returns:
- remote repository url
-
isVersionnableFile
Description copied from interface:VCS
Check if file can be put in vcs repository. For example when you used CVS, you must not put CVS file.default refused .svn, CVS and ~ filename Must be override, this default implementation return true.
- Specified by:
isVersionnableFile
in interfaceVCS
- Overrides:
isVersionnableFile
in classAbstractVCS
- Returns:
true
if file is versionnable
-
cleanup
Cleanup a directory, removing all lock. Perform a "svn cleanup" command.- Parameters:
path
- path to cleanup- Throws:
VCSException
-
commit
Commit specified files, if files is null, all files are committed.- Parameters:
files
- files to commitmsg
- message used to commit- Throws:
VCSException
-
commitWithoutCheck
Commit without ask for registred listeners.- Parameters:
files
- files to commitmsg
- message for commit- Throws:
VCSException
-
add
Perform : - svn add - commit- Parameters:
files
- list of file to addmsg
- message for commit- Throws:
VCSException
-
checkout
Description copied from interface:VCS
get repository on server and put it in localdir.- Parameters:
tag
- tag to used, null = /trunk other is tags/[tag]recurse
- if file is directory checkout sub file- Throws:
VCSException
-
delete
Description copied from interface:VCS
Delete and commit files in server repository.- Parameters:
files
- file to deletemsg
- message for commit- Throws:
VCSException
-
getLocalStatus
Description copied from interface:VCS
Get file local status.- Parameters:
file
- file to get status- Returns:
- file status
- Throws:
VCSException
-
getLocalStatus
protected Map<File,org.tmatesoft.svn.core.wc.SVNStatus> getLocalStatus(File file, boolean recurse, org.tmatesoft.svn.core.wc.SVNStatusType... wanted) throws VCSException Recherche le statut des fichiers locaux, ne retourne jamais les fichiers NORMAL ou NONE sauf si demandé explicitement via wanted- Parameters:
file
- le repertoire a partir duquel on souhaite le statusrecurse
- si l'on souhaite le faire recursivementwanted
- l'ensemble des status type que l'on recheche, si vide recherche tous les statuts- Returns:
- une map avec comme cle le File local et en valeur le status
- Throws:
VCSException
-
getRemoteStatus
protected Map<File,org.tmatesoft.svn.core.wc.SVNStatus> getRemoteStatus(File file, boolean recurse) throws VCSException Retourne la liste des fichiers qui ont été mis à jour sur le serveur. Le status des fichiers retourné est :- SVNStatusType.STATUS_ADDED (remote) pour ajout local
- SVNStatusType.STATUS_DELETED (remote) pour suppression locale
- Parameters:
file
-recurse
-- Returns:
- remote status
- Throws:
VCSException
-
getChanglog
Return all changelog between local file version and remote repository file version.- Parameters:
files
-- Returns:
- changelog for each file
- Throws:
VCSException
-
getDiff
show diff between local file and repository file.- Parameters:
file
- file to get diff- Returns:
- string diff
- Throws:
VCSException
-
getFileList
Description copied from interface:VCS
Return list of all file on directory on remote server.- Returns:
- files list
- Throws:
VCSException
-
getUpdatedFile
get list of new or modified files on server.- Returns:
- list of modified or new files
- Throws:
VCSException
-
haveUpdate
Ask if there are some new or modified files on server.- Returns:
- true if new file available
- Throws:
VCSException
-
isOnRemote
Check if file is available on server.- Parameters:
file
- file to check- Returns:
- true if file available
- Throws:
VCSException
-
isUpToDate
Check if file is uptodate.- Parameters:
file
- file to check- Returns:
- true if file is in last version
- Throws:
VCSException
-
update
Description copied from interface:VCS
Update file.- Parameters:
file
- files to update- Returns:
- true if there are some merging conflict, false otherwise
- Throws:
VCSException
-
isWriteable
Description copied from interface:VCS
Return true, if local repository is writable. (use trunk and is not anonymous)- Returns:
- writable
- Throws:
VCSException
-
isTag
Description copied from interface:VCS
Look on server if version is tag repository.- Parameters:
version
- version number like 3.2- Returns:
- true if tag found with this name
- Throws:
VCSException
-
getTag
Description copied from interface:VCS
Retourne le tag reellement utilise, par exemple si on a fait un setTag(3.2.0) cette methode retourne "/tags/3.2.0", pour setTag(null) on retourne "/trunk"- Returns:
- tag
- Throws:
VCSException
-
setTag
Description copied from interface:VCS
Change repository tag, used when we use some tag and we want to go to trunk.- Parameters:
version
- version to go, if null trunk is used, otherwize tags/version is used- Returns:
- a list of all file in conflict
- Throws:
VCSException
-