protected SVNCommitInfo setupCopy(SVNCopySource[] sources, SVNPath dst, boolean isMove, boolean makeParents,
String message, SVNProperties revprops, ISVNCommitHandler commitHandler, ISVNCommitParameters commitParameters, ISVNExternalsHandler externalsHandler) throws SVNException {
List pairs = new ArrayList(sources.length);
for (int i = 0; i < sources.length; i++) {
SVNCopySource source = sources[i];
if (source.isURL() &&
(source.getPegRevision() == SVNRevision.BASE ||
source.getPegRevision() == SVNRevision.COMMITTED ||
source.getPegRevision() == SVNRevision.PREVIOUS)) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.CLIENT_BAD_REVISION,
"Revision type requires a working copy path, not URL");
SVNErrorManager.error(err, SVNLogType.WC);
}
}
boolean srcIsURL = sources[0].isURL();
boolean dstIsURL = dst.isURL();
if (sources.length > 1) {
for (int i = 0; i < sources.length; i++) {
SVNCopySource source = sources[i];
CopyPair pair = new CopyPair();
pair.mySource = source.isURL() ? source.getURL().toString() : source.getFile().getAbsolutePath().replace(File.separatorChar, '/');
pair.setSourceRevisions(source.getPegRevision(), source.getRevision());
if (SVNPathUtil.isURL(pair.mySource) != srcIsURL) {
SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.UNSUPPORTED_FEATURE,
"Cannot mix repository and working copy sources");
SVNErrorManager.error(err, SVNLogType.WC);
}
String baseName = source.getName();
if (srcIsURL && !dstIsURL) {
baseName = SVNEncodingUtil.uriDecode(baseName);
}
pair.myDst = dstIsURL ? dst.getURL().appendPath(baseName, true).toString() :
new File(dst.getFile(), baseName).getAbsolutePath().replace(File.separatorChar, '/');
pairs.add(pair);
}
} else {
SVNCopySource source = sources[0];
CopyPair pair = new CopyPair();
pair.mySource = source.isURL() ? source.getURL().toString() : source.getFile().getAbsolutePath().replace(File.separatorChar, '/');
pair.setSourceRevisions(source.getPegRevision(), source.getRevision());
pair.myDst = dstIsURL ? dst.getURL().toString() : dst.getFile().getAbsolutePath().replace(File.separatorChar, '/');
pairs.add(pair);
}
if (!srcIsURL && !dstIsURL) {