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()]); }
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; }