private SVNURL getCopySourceURL(SVNCopySource source) throws SVNException { if (source == null) { return null; } if (source.isURL()) { return source.getURL(); } String relativePath = SVNPathUtil.getPathAsChild(myTarget.getAbsolutePath(), source.getFile().getAbsolutePath()); if (relativePath == null) { SVNDebugLog.getDefaultLog().logFine(SVNLogType.WC, "merge ext: illegal file path passed as copy source"); return null; } return myTargetURL.appendPath(relativePath, false); }
public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("merge task: source from "); buffer.append(getMergeSource()); buffer.append("; source to"); buffer.append(getMergeSource2()); buffer.append("; target "); buffer.append(getMergeTarget()); buffer.append("; revision ranges "); if (getRemainingRanges() == null) { buffer.append("[NULL]"); } else { buffer.append(getRemainingRanges().toString()); } buffer.append("; copy source "); if (getTargetCopySource() != null) { buffer.append(getTargetCopySource().isURL() ? getTargetCopySource().getURL().toString() : getTargetCopySource().getFile().getAbsolutePath()); buffer.append("@"); buffer.append(getTargetCopySource().getPegRevision().toString()); buffer.append(" revision "); buffer.append(getTargetCopySource().getRevision()); } else { buffer.append("[NULL]"); } return buffer.toString(); } }
String path = source.getURL() == null ? source.getFile().getAbsolutePath() : source.getURL().toString(); writer.write(path);
protected long getRevision(SVNCopySource copySource) throws SVNException { return getRevisionNumber(copySource.getRevision(), getRepository(copySource.getURL()), copySource.getFile()); }
public static SvnCopySource copySource(SVNCopySource oldSource) { SvnTarget target; if (oldSource.isURL()) { target = SvnTarget.fromURL(oldSource.getURL(), oldSource.getPegRevision()); } else { target = SvnTarget.fromFile(oldSource.getFile(), oldSource.getPegRevision()); } final SvnCopySource copySource = SvnCopySource.create(target, oldSource.getRevision()); copySource.setCopyContents(oldSource.isCopyContents()); return copySource; }
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) { 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, '/');
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) { 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, '/');
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) { 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, '/');
private File getCopySourcePath(SVNCopySource source) { if (source == null) { return null; } if (!source.isURL()) { return source.getFile(); } File target = null; String sPath = SVNPathUtil.getPathAsChild(mySourceURL.getPath(), source.getURL().getPath()); String tPath = SVNPathUtil.getPathAsChild(myTargetURL.getPath(), source.getURL().getPath()); if (sPath != null) { target = getFile(sPath); } else if (tPath != null) { target = getFile(tPath); } else { SVNDebugLog.getDefaultLog().logFine(SVNLogType.WC, "merge ext: Neither merge source URL nor merge target URL are not ancestors of copy source URL"); } return target; }
private Void virtualCopy() throws SVNException { SVNMoveClient16 client = new SVNMoveClient16(getOperation().getRepositoryPool(), getOperation().getOptions()); client.setEventHandler(getOperation().getEventHandler()); client.setOptions(getOperation().getOptions()); final SvnTarget target = getOperation().getFirstTarget(); if (target.isURL()) { throwCannotPerformOnUrl(target, "virtual", getOperation().isMove() ? "move" : "copy"); } final SVNCopySource[] sources = getCopySources(); for (SVNCopySource source : sources) { client.doVirtualCopy(source.getFile(), target.getFile(), getOperation().isMove()); } return null; }