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(); } }
SVNRevision pegRevision = source.getPegRevision() == null ? SVNRevision.UNDEFINED : source.getPegRevision(); writer.write(pegRevision.toString());
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; }
protected SVNCopySource[] expandCopySources(SVNCopySource[] sources) throws SVNException { Collection expanded = new ArrayList(sources.length); for (int i = 0; i < sources.length; i++) { SVNCopySource source = sources[i]; if (source.isCopyContents() && source.isURL()) { // get children at revision. SVNRevision pegRevision = source.getPegRevision(); if (!pegRevision.isValid()) { pegRevision = SVNRevision.HEAD; } SVNRevision startRevision = source.getRevision(); if (!startRevision.isValid()) { startRevision = pegRevision; } SVNRepositoryLocation[] locations = getLocations(source.getURL(), null, null, pegRevision, startRevision, SVNRevision.UNDEFINED); SVNRepository repository = createRepository(locations[0].getURL(), null, null, true); long revision = locations[0].getRevisionNumber(); Collection entries = new ArrayList(); repository.getDir("", revision, null, 0, entries); for (Iterator ents = entries.iterator(); ents.hasNext();) { SVNDirEntry entry = (SVNDirEntry) ents.next(); // add new copy source. expanded.add(new SVNCopySource(SVNRevision.UNDEFINED, source.getRevision(), entry.getURL())); } } else { expanded.add(source); } } return (SVNCopySource[]) expanded.toArray(new SVNCopySource[expanded.size()]); }
protected SVNCopySource[] expandCopySources(SVNCopySource[] sources) throws SVNException { Collection expanded = new ArrayList(sources.length); for (int i = 0; i < sources.length; i++) { SVNCopySource source = sources[i]; if (source.isCopyContents() && source.isURL()) { // get children at revision. SVNRevision pegRevision = source.getPegRevision(); if (!pegRevision.isValid()) { pegRevision = SVNRevision.HEAD; } SVNRevision startRevision = source.getRevision(); if (!startRevision.isValid()) { startRevision = pegRevision; } SVNRepositoryLocation[] locations = getLocations(source.getURL(), null, null, pegRevision, startRevision, SVNRevision.UNDEFINED); SVNRepository repository = createRepository(locations[0].getURL(), null, null, true); long revision = locations[0].getRevisionNumber(); Collection entries = new ArrayList(); repository.getDir("", revision, null, 0, entries); for (Iterator ents = entries.iterator(); ents.hasNext();) { SVNDirEntry entry = (SVNDirEntry) ents.next(); // add new copy source. expanded.add(new SVNCopySource(SVNRevision.UNDEFINED, source.getRevision(), entry.getURL())); } } else { expanded.add(source); } } return (SVNCopySource[]) expanded.toArray(new SVNCopySource[expanded.size()]); }
protected SVNCopySource[] expandCopySources(SVNCopySource[] sources) throws SVNException { Collection expanded = new ArrayList(sources.length); for (int i = 0; i < sources.length; i++) { SVNCopySource source = sources[i]; if (source.isCopyContents() && source.isURL()) { // get children at revision. SVNRevision pegRevision = source.getPegRevision(); if (!pegRevision.isValid()) { pegRevision = SVNRevision.HEAD; } SVNRevision startRevision = source.getRevision(); if (!startRevision.isValid()) { startRevision = pegRevision; } SVNRepositoryLocation[] locations = getLocations(source.getURL(), null, null, pegRevision, startRevision, SVNRevision.UNDEFINED); SVNRepository repository = createRepository(locations[0].getURL(), null, null, true); long revision = locations[0].getRevisionNumber(); Collection entries = new ArrayList(); repository.getDir("", revision, null, 0, entries); for (Iterator ents = entries.iterator(); ents.hasNext();) { SVNDirEntry entry = (SVNDirEntry) ents.next(); // add new copy source. expanded.add(new SVNCopySource(SVNRevision.UNDEFINED, source.getRevision(), entry.getURL())); } } else { expanded.add(source); } } return (SVNCopySource[]) expanded.toArray(new SVNCopySource[expanded.size()]); }
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"); 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, 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);
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"); 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, 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);
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"); 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, 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);
private SVNCopySource processCopySource(SVNCopySource copySource, long targetRevision) throws SVNException { if (copySource == null) { return null; } if (copySource.isURL() && (copySource.getRevision() != null && copySource.getRevision().getID() == 10)) { return copySource; } SVNRevision pegRevision; SVNRevision revision; try { pegRevision = processCopySourceRevision(copySource.getPegRevision(), copySource, targetRevision); revision = processCopySourceRevision(copySource.getRevision(), copySource, targetRevision); } catch (SVNException e) { SVNDebugLog.getDefaultLog().logFine(SVNLogType.WC, "merge ext: Error while fetching copy source revision"); return null; } SVNURL url = copySource.getURL(); if (url == null) { url = getCopySourceURL(copySource); if (url == null) { return null; } } return new SVNCopySource(pegRevision, revision, url); }