public String toString() { StringBuffer buffer = new StringBuffer(); buffer.append("[merge target: path = "); buffer.append(myPath); buffer.append("; wc file = "); buffer.append(myWCFile); buffer.append("; file = "); buffer.append(myFile); buffer.append("; base file = "); buffer.append(myCurrentFile.myBaseFile); buffer.append("; copyFromURL = "); buffer.append(myCopySource == null ? null : myCopySource.getURL()); buffer.append("; copyFromRevision = "); buffer.append(myCopySource == null ? "unknown" : String.valueOf(myCopySource.getRevision())); buffer.append("]"); return buffer.toString(); } }
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 revision = source.getRevision() == null ? SVNRevision.UNDEFINED : source.getRevision(); writer.write(revision.toString());
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()]); }
protected long getRevision(SVNCopySource copySource) throws SVNException { return getRevisionNumber(copySource.getRevision(), getRepository(copySource.getURL()), copySource.getFile()); }
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); }
protected void doVirtualCopy(SVNEntry dstEntry, SVNCopySource copySource, boolean save) throws SVNException { dstEntry.setCopyFromURL(copySource.getURL().toString()); long cfRevision = copySource.getRevision().getNumber(); dstEntry.setCopyFromRevision(cfRevision); if (save) { SVNAdminArea dir = dstEntry.getAdminArea(); dir.saveEntries(false); } }
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; }
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);
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);
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);
protected void close() throws SVNException { SVNDebugLog.getDefaultLog().logFine(SVNLogType.WC, "ext merge: close " + myPath); closeFile(myPath, myCurrentFile.myIsAdded, myWCFile, myFile, myCurrentFile.myPropertyDiff, myCurrentFile.myBaseProperties, myCurrentFile.myBaseFile, null); if (myCopySource == null) { return; } SVNEntry targetEntry = myWCAccess.getEntry(myWCFile, false); if (targetEntry != null) { SVNURL copyFromLocation = targetEntry.getCopyFromSVNURL(); long copyFromRevision = targetEntry.getCopyFromRevision(); SVNURL sourceURL = myCopySource.getURL(); long sourceRevision = myCopySource.getRevision().getNumber(); if (copyFromLocation == null || !copyFromLocation.equals(sourceURL) || copyFromRevision != sourceRevision) { getMergeDriver().copy(myCopySource, myWCFile, true); } } }