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
-
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 TypeMethodDescriptionvoid
Moves a source item to a destination one.void
doVirtualCopy
(File src, File dst, boolean move) Copies/moves administrative version control information of a source file to administrative information of a destination file.void
Reverts 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
options
is 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 onISVNOptions
andSVNWCUtil
).If
authManager
is 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. Ifoptions
is 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 onISVNOptions
andSVNWCUtil
). IfrepositoryPool
is null, thenSVNRepositoryFactory
will 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.dst
should not exist. Furher it's considered to be versioned if its parent directory is under version control, otherwisedst
is considered to be unversioned.If both
src
anddst
are unversioned, then simply movessrc
todst
in the filesystem.If
src
is versioned butdst
is not, then exportssrc
todst
in the filesystem and removessrc
from version control.If
dst
is versioned butsrc
is not, then movessrc
todst
(even ifdst
is scheduled for deletion).If both
src
anddst
are versioned and located within the same Working Copy, then movessrc
todst
(even ifdst
is scheduled for deletion), or tries to replacedst
withsrc
if the former is missing and has a node kind different from the node kind of the source. Ifsrc
is scheduled for addition with history,dst
will be set the same ancestor URL and revision from which the source was copied. Ifsrc
anddst
are located in different Working Copies, then this method copiessrc
todst
, 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:dst
already existssrc
does not exist
-
undoMove
Reverts a previous move operation back. Provided in pair withdoMove()
and used to roll back move operations. In this casesrc
is considered to be the target of the previsous move operation, anddst
is regarded to be the source of that same operation which have been moved tosrc
and now is to be restored.dst
could exist in that case if it has been a WC directory that was scheduled for deletion during the previous move operation. Furherdst
is considered to be versioned if its parent directory is under version control, otherwisedst
is considered to be unversioned.If both
src
anddst
are unversioned, then simply movessrc
back todst
in the filesystem.If
src
is versioned butdst
is not, then unmovessrc
todst
in the filesystem and removessrc
from version control.If
dst
is versioned butsrc
is not, then first tries to make a revert ondst
- if it has not been committed yet, it will be simply reverted. However in the casedst
has been already removed from the repository,src
will be copied back todst
and scheduled for addition. Thensrc
is removed from the filesystem.If both
src
anddst
are versioned then the following situations are possible:- If
dst
is still scheduled for deletion, then it is reverted back andsrc
is scheduled for deletion. - in the case if
dst
exists but is not scheduled for deletion,src
is cleanly exported todst
and removed from version control. - if
dst
andsrc
are from different repositories (appear to be in different Working Copies), thensrc
is copied todst
(with schedulingdst
for addition, but not with history since copying is made in the filesystem only) and removed from version control. - if both
dst
andsrc
are in the same repository (appear to be located in the same Working Copy) and:- if
src
is scheduled for addition with history, then copiessrc
todst
specifying the source ancestor's URL and revision (i.e. the ancestor of the source is the ancestor of the destination); - if
src
is already under version control, then copiessrc
todst
specifying the source URL and revision as the ancestor (i.e.src
itself is the ancestor ofdst
); - if
src
is just scheduled for addition (without history), then simply copiessrc
todst
(only in the filesystem, without history) and schedulesdst
for addition;
src
is removed from version control. - if
- Parameters:
src
- a source pathdst
- a destination path- Throws:
SVNException
- ifsrc
does 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 movingsrc
todst
, otherwise completes copyingsrc
todst
- Throws:
SVNException
- if one of the following is true:move =
true andsrc
still existsdst
does not existdst
is a directorysrc
is a directorysrc
is not under version controldst
is already under version control- if
src
is copied but not scheduled for addition, and SVNKit is not able to locate the copied directory root forsrc
-