Class SVNMoveClient
- move versioned items to other versioned ones within the same Working Copy, what even allows to replace items scheduled for deletion, or those that are missing but are still under version control and have a node kind different from the node kind of the source (!);
- move versioned items belonging to one Working Copy to versioned items that belong to absolutely different Working Copy;
- move versioned items to unversioned ones;
- move unversioned items to versioned ones;
- move unversioned items to unversioned ones;
- revert any of the kinds of moving listed above;
- complete a copy/move operation for a file, that is if you have manually copied/moved a versioned file to an unversioned file in a Working copy, you can run a 'virtual' copy/move on these files to copy/move all the necessary administrative version control information.
- Since:
- 1.2
- Version:
- 1.3
- Author:
- TMate Software Ltd.
-
Constructor Summary
ConstructorsConstructorDescriptionSVNMoveClient(ISVNAuthenticationManager authManager, ISVNOptions options) Constructs and initializes an SVNMoveClient object with the specified run-time configuration and authentication drivers.SVNMoveClient(ISVNRepositoryPool repositoryPool, ISVNOptions options) Constructs and initializes an SVNMoveClient object with the specified run-time configuration and repository pool object. -
Method Summary
Modifier and TypeMethodDescriptionvoidMoves a source item to a destination one.voiddoVirtualCopy(File src, File dst, boolean move) Copies/moves administrative version control information of a source file to administrative information of a destination file.voidReverts a previous move operation back.Methods inherited from class org.tmatesoft.svn.core.wc.SVNBasicClient
dontWC17Support, getDebugLog, getOperationsFactory, getOptions, getPathListHandler, getReposRoot, getReposRoot, initDefaults, isIgnoreExternals, isLeaveConflictsUnresolved, isWC17Supported, setDebugLog, setEventHandler, setEventPathPrefix, setIgnoreExternals, setLeaveConflictsUnresolved, setOptions, setPathListHandler
-
Constructor Details
-
SVNMoveClient
Constructs and initializes an SVNMoveClient object with the specified run-time configuration and authentication drivers.If
optionsis null, then this SVNMoveClient will be using a default run-time configuration driver which takes client-side settings from the default SVN's run-time configuration area but is not able to change those settings (read more onISVNOptionsandSVNWCUtil).If
authManageris null, then this SVNMoveClient will be using a default authentication and network layers driver (seeSVNWCUtil.createDefaultAuthenticationManager()) which uses server-side settings and auth storage from the default SVN's run-time configuration area (or system properties if that area is not found).- Parameters:
authManager- an authentication and network layers driveroptions- a run-time configuration options driver
-
SVNMoveClient
Constructs and initializes an SVNMoveClient object with the specified run-time configuration and repository pool object. Ifoptionsis null, then this SVNMoveClient will be using a default run-time configuration driver which takes client-side settings from the default SVN's run-time configuration area but is not able to change those settings (read more onISVNOptionsandSVNWCUtil). IfrepositoryPoolis null, thenSVNRepositoryFactorywill be used to createrepository access objects.- Parameters:
repositoryPool- a repository pool objectoptions- a run-time configuration options driver
-
SVNMoveClient
-
-
Method Details
-
doMove
Moves a source item to a destination one.dstshould not exist. Furher it's considered to be versioned if its parent directory is under version control, otherwisedstis considered to be unversioned.If both
srcanddstare unversioned, then simply movessrctodstin the filesystem.If
srcis versioned butdstis not, then exportssrctodstin the filesystem and removessrcfrom version control.If
dstis versioned butsrcis not, then movessrctodst(even ifdstis scheduled for deletion).If both
srcanddstare versioned and located within the same Working Copy, then movessrctodst(even ifdstis scheduled for deletion), or tries to replacedstwithsrcif the former is missing and has a node kind different from the node kind of the source. Ifsrcis scheduled for addition with history,dstwill be set the same ancestor URL and revision from which the source was copied. Ifsrcanddstare located in different Working Copies, then this method copiessrctodst, tries to put the latter under version control and finally removessrc.- Parameters:
src- a source pathdst- a destination path- Throws:
SVNException- if one of the following is true:dstalready existssrcdoes not exist
-
undoMove
Reverts a previous move operation back. Provided in pair withdoMove()and used to roll back move operations. In this casesrcis considered to be the target of the previsous move operation, anddstis regarded to be the source of that same operation which have been moved tosrcand now is to be restored.dstcould exist in that case if it has been a WC directory that was scheduled for deletion during the previous move operation. Furherdstis considered to be versioned if its parent directory is under version control, otherwisedstis considered to be unversioned.If both
srcanddstare unversioned, then simply movessrcback todstin the filesystem.If
srcis versioned butdstis not, then unmovessrctodstin the filesystem and removessrcfrom version control.If
dstis versioned butsrcis not, then first tries to make a revert ondst- if it has not been committed yet, it will be simply reverted. However in the casedsthas been already removed from the repository,srcwill be copied back todstand scheduled for addition. Thensrcis removed from the filesystem.If both
srcanddstare versioned then the following situations are possible:- If
dstis still scheduled for deletion, then it is reverted back andsrcis scheduled for deletion. - in the case if
dstexists but is not scheduled for deletion,srcis cleanly exported todstand removed from version control. - if
dstandsrcare from different repositories (appear to be in different Working Copies), thensrcis copied todst(with schedulingdstfor addition, but not with history since copying is made in the filesystem only) and removed from version control. - if both
dstandsrcare in the same repository (appear to be located in the same Working Copy) and:- if
srcis scheduled for addition with history, then copiessrctodstspecifying the source ancestor's URL and revision (i.e. the ancestor of the source is the ancestor of the destination); - if
srcis already under version control, then copiessrctodstspecifying the source URL and revision as the ancestor (i.e.srcitself is the ancestor ofdst); - if
srcis just scheduled for addition (without history), then simply copiessrctodst(only in the filesystem, without history) and schedulesdstfor addition;
srcis removed from version control. - if
- Parameters:
src- a source pathdst- a destination path- Throws:
SVNException- ifsrcdoes not exist
- If
-
doVirtualCopy
Copies/moves administrative version control information of a source file to administrative information of a destination file. For example, if you have manually copied/moved a source file to a target one (manually means just in the filesystem, not using version control operations) and then would like to turn this copying/moving into a complete version control copy or move operation, use this method that will finish all the work for you - it will copy/move all the necessary administrative information (kept in the source .svn directory) to the target .svn directory.In that case when you have your files copied/moved in the filesystem, you can not perform standard (version control) copying/moving - since the target already exists and the source may be already deleted. Use this method to overcome that restriction.
- Parameters:
src- a source file path (was copied/moved todst)dst- a destination file pathmove- if true then completes movingsrctodst, otherwise completes copyingsrctodst- Throws:
SVNException- if one of the following is true:move =true andsrcstill existsdstdoes not existdstis a directorysrcis a directorysrcis not under version controldstis already under version control- if
srcis copied but not scheduled for addition, and SVNKit is not able to locate the copied directory root forsrc
-