Class SvnNgWcToWcCopy
- java.lang.Object
-
- org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner<V,T>
-
- org.tmatesoft.svn.core.internal.wc2.SvnLocalOperationRunner<V,T>
-
- org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner<java.lang.Void,SvnCopy>
-
- org.tmatesoft.svn.core.internal.wc2.ng.SvnNgWcToWcCopy
-
- All Implemented Interfaces:
ISVNCanceller
,ISVNEventHandler
,ISvnOperationRunner<java.lang.Void,SvnCopy>
public class SvnNgWcToWcCopy extends SvnNgOperationRunner<java.lang.Void,SvnCopy>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
SvnNgWcToWcCopy.CopyToTmpDir
private static class
SvnNgWcToWcCopy.SvnCopyPair
-
Field Summary
-
Fields inherited from interface org.tmatesoft.svn.core.ISVNCanceller
NULL
-
Fields inherited from interface org.tmatesoft.svn.core.wc.ISVNEventHandler
UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description SvnNgWcToWcCopy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
areAllSourcesLocal(SvnCopy operation)
private void
checkForDisjointCopyPossibility(SVNWCContext context, java.io.File nestedWC, java.io.File nestedWCParent)
protected boolean
copy(SVNWCContext context, java.io.File source, java.io.File dst, boolean metadataOnly)
private boolean
copy(SVNWCContext context, java.util.Collection<SvnCopySource> sources, java.io.File target)
private void
copyBaseDataOfFile(SVNWCContext context, java.io.File source, java.io.File dst)
private void
copyPristineFiles(java.io.File sourceWc, java.io.File targetWc, boolean move)
private SvnNgWcToWcCopy.CopyToTmpDir
copyToTmpDir(java.io.File srcAbsPath, java.io.File dstAbsPath, java.io.File tmpDirAbsPath, boolean fileCopy, boolean unversioned)
private void
copyVersionedDirectory(SVNWCContext wcContext, java.io.File srcAbsPath, java.io.File dstAbsPath, java.io.File dstOpRootAbsPath, java.io.File tmpDirAbsPath, boolean metadataOnly, boolean isMove, boolean notify)
private void
copyVersionedFile(SVNWCContext wcContext, java.io.File srcAbsPath, java.io.File dstAbsPath, java.io.File dstOpRootAbsPath, java.io.File tmpDirAbsPath, boolean metadataOnly, boolean conflicted, boolean isMove, boolean notify)
private boolean
disjointCopy(SVNWCContext context, java.io.File nestedWC)
The method performs "disjoint" copy (see SVNCopyClient#doCopy(File)) The algorithm is: 1.private java.io.File
getAdminDirectory(java.io.File parentWC)
private java.io.File
getPristineDirectory(java.io.File workingCopyDirectory)
private SvnStatus
getStatus(java.io.File interestingFile)
private java.io.File
getWCDbFile(java.io.File nestedWC)
private boolean
hasMetadataInParentWc(SVNWCDb wcdb, java.io.File nestedWC, java.io.File nestedWCParent)
boolean
isApplicable(SvnCopy operation, SvnWcGeneration wcGeneration)
Returns whether this runner is applicable for the operation on concrete working copy generation (1.7 or 1.6)private boolean
isLocalRevision(SVNRevision revision)
private boolean
move(java.util.Collection<SvnNgWcToWcCopy.SvnCopyPair> pairs)
void
move(SVNWCContext context, java.io.File source, java.io.File dst, boolean metadataOnly)
private void
moveWcDb(java.io.File sourceWc, java.io.File targetWc)
private void
removeAllConflictMarkers(ISVNWCDb db, java.io.File srcDirAbsPath, java.io.File wcDirAbsPath)
private void
removeNodeConflictMarkers(ISVNWCDb db, java.io.File srcAbsPath, java.io.File nodeAbsPath)
private java.util.Map<java.lang.String,SVNPropertyValue>
resolvePinnedExternals(java.util.Map<SvnTarget,java.util.List<SVNExternal>> externalsToPin, SvnNgWcToWcCopy.SvnCopyPair copyPair, SVNRepository svnRepository, SVNURL reposRootUrl)
protected java.lang.Void
run(SVNWCContext context)
private boolean
shouldCopyBaseData(SVNWCContext context, java.io.File source, boolean metadataOnly, ISVNWCDb.SVNWCDbStatus srcStatus)
protected boolean
tryRun(SVNWCContext context, java.util.Collection<SvnCopySource> sources, java.io.File target)
private void
verifyPaths(java.util.Collection<SvnNgWcToWcCopy.SvnCopyPair> copyPairs, boolean makeParents, boolean move)
private boolean
verifyPaths(SVNFileType srcType, SVNFileType dstType, SvnNgWcToWcCopy.SvnCopyPair copyPair, int copyPairsCount, boolean move)
private void
verifyPathsExistenceForVirtualCopy(java.io.File source, java.io.File dst, SVNFileType srcType, SVNFileType dstType, SvnNgWcToWcCopy.SvnCopyPair copyPair, boolean move)
-
Methods inherited from class org.tmatesoft.svn.core.internal.wc2.ng.SvnNgOperationRunner
deleteDeleteFiles, getRepositoryAccess, getWcGeneration, matchesChangelist, reset, run, setRepositoryAccess
-
Methods inherited from class org.tmatesoft.svn.core.internal.wc2.SvnLocalOperationRunner
getFirstTarget, sleepForTimestamp
-
Methods inherited from class org.tmatesoft.svn.core.internal.wc2.SvnOperationRunner
checkCancelled, getOperation, getWcContext, handleEvent, handleEvent, run, setOperation, setWcContext
-
-
-
-
Method Detail
-
isApplicable
public boolean isApplicable(SvnCopy operation, SvnWcGeneration wcGeneration) throws SVNException
Description copied from interface:ISvnOperationRunner
Returns whether this runner is applicable for the operation on concrete working copy generation (1.7 or 1.6)- Specified by:
isApplicable
in interfaceISvnOperationRunner<java.lang.Void,SvnCopy>
- Overrides:
isApplicable
in classSvnLocalOperationRunner<java.lang.Void,SvnCopy>
- Parameters:
operation
- operation that needs runnerwcGeneration
- working copy generation- Returns:
true
if the runner is applicable, otherwisefalse
- Throws:
SVNException
-
areAllSourcesLocal
private boolean areAllSourcesLocal(SvnCopy operation)
-
isLocalRevision
private boolean isLocalRevision(SVNRevision revision)
-
run
protected java.lang.Void run(SVNWCContext context) throws SVNException
- Specified by:
run
in classSvnNgOperationRunner<java.lang.Void,SvnCopy>
- Throws:
SVNException
-
tryRun
protected boolean tryRun(SVNWCContext context, java.util.Collection<SvnCopySource> sources, java.io.File target) throws SVNException
- Throws:
SVNException
-
disjointCopy
private boolean disjointCopy(SVNWCContext context, java.io.File nestedWC) throws SVNException
The method performs "disjoint" copy (see SVNCopyClient#doCopy(File)) The algorithm is: 1. Create a fake working copy 2. Move wc.db from the nested working copy to the fake 3. Move all pristine files to the parent working copy 4. Perform metadata copying- Parameters:
context
-nestedWC
-- Returns:
- Throws:
SVNException
-
checkForDisjointCopyPossibility
private void checkForDisjointCopyPossibility(SVNWCContext context, java.io.File nestedWC, java.io.File nestedWCParent) throws SVNException
- Throws:
SVNException
-
moveWcDb
private void moveWcDb(java.io.File sourceWc, java.io.File targetWc) throws SVNException
- Throws:
SVNException
-
copyPristineFiles
private void copyPristineFiles(java.io.File sourceWc, java.io.File targetWc, boolean move) throws SVNException
- Throws:
SVNException
-
getPristineDirectory
private java.io.File getPristineDirectory(java.io.File workingCopyDirectory)
-
getWCDbFile
private java.io.File getWCDbFile(java.io.File nestedWC)
-
getAdminDirectory
private java.io.File getAdminDirectory(java.io.File parentWC)
-
hasMetadataInParentWc
private boolean hasMetadataInParentWc(SVNWCDb wcdb, java.io.File nestedWC, java.io.File nestedWCParent) throws SVNException
- Throws:
SVNException
-
copy
private boolean copy(SVNWCContext context, java.util.Collection<SvnCopySource> sources, java.io.File target) throws SVNException
- Throws:
SVNException
-
resolvePinnedExternals
private java.util.Map<java.lang.String,SVNPropertyValue> resolvePinnedExternals(java.util.Map<SvnTarget,java.util.List<SVNExternal>> externalsToPin, SvnNgWcToWcCopy.SvnCopyPair copyPair, SVNRepository svnRepository, SVNURL reposRootUrl) throws SVNException
- Throws:
SVNException
-
move
private boolean move(java.util.Collection<SvnNgWcToWcCopy.SvnCopyPair> pairs) throws SVNException
- Throws:
SVNException
-
verifyPaths
private void verifyPaths(java.util.Collection<SvnNgWcToWcCopy.SvnCopyPair> copyPairs, boolean makeParents, boolean move) throws SVNException
- Throws:
SVNException
-
verifyPaths
private boolean verifyPaths(SVNFileType srcType, SVNFileType dstType, SvnNgWcToWcCopy.SvnCopyPair copyPair, int copyPairsCount, boolean move) throws SVNException
- Throws:
SVNException
-
verifyPathsExistenceForVirtualCopy
private void verifyPathsExistenceForVirtualCopy(java.io.File source, java.io.File dst, SVNFileType srcType, SVNFileType dstType, SvnNgWcToWcCopy.SvnCopyPair copyPair, boolean move) throws SVNException
- Throws:
SVNException
-
getStatus
private SvnStatus getStatus(java.io.File interestingFile) throws SVNException
- Throws:
SVNException
-
move
public void move(SVNWCContext context, java.io.File source, java.io.File dst, boolean metadataOnly) throws SVNException
- Throws:
SVNException
-
removeAllConflictMarkers
private void removeAllConflictMarkers(ISVNWCDb db, java.io.File srcDirAbsPath, java.io.File wcDirAbsPath) throws SVNException
- Throws:
SVNException
-
removeNodeConflictMarkers
private void removeNodeConflictMarkers(ISVNWCDb db, java.io.File srcAbsPath, java.io.File nodeAbsPath) throws SVNException
- Throws:
SVNException
-
copy
protected boolean copy(SVNWCContext context, java.io.File source, java.io.File dst, boolean metadataOnly) throws SVNException
- Throws:
SVNException
-
shouldCopyBaseData
private boolean shouldCopyBaseData(SVNWCContext context, java.io.File source, boolean metadataOnly, ISVNWCDb.SVNWCDbStatus srcStatus) throws SVNException
- Throws:
SVNException
-
copyBaseDataOfFile
private void copyBaseDataOfFile(SVNWCContext context, java.io.File source, java.io.File dst) throws SVNException
- Throws:
SVNException
-
copyVersionedDirectory
private void copyVersionedDirectory(SVNWCContext wcContext, java.io.File srcAbsPath, java.io.File dstAbsPath, java.io.File dstOpRootAbsPath, java.io.File tmpDirAbsPath, boolean metadataOnly, boolean isMove, boolean notify) throws SVNException
- Throws:
SVNException
-
copyVersionedFile
private void copyVersionedFile(SVNWCContext wcContext, java.io.File srcAbsPath, java.io.File dstAbsPath, java.io.File dstOpRootAbsPath, java.io.File tmpDirAbsPath, boolean metadataOnly, boolean conflicted, boolean isMove, boolean notify) throws SVNException
- Throws:
SVNException
-
copyToTmpDir
private SvnNgWcToWcCopy.CopyToTmpDir copyToTmpDir(java.io.File srcAbsPath, java.io.File dstAbsPath, java.io.File tmpDirAbsPath, boolean fileCopy, boolean unversioned) throws SVNException
- Throws:
SVNException
-
-