public void handleDirEntry( SVNDirEntry svnDirEntry ) throws SVNException { infos.put( svnDirEntry.getName(), svnDirEntry.getURL().toString() ); } }
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { dirEntry.setLock((SVNLock) locksMap.get(dirEntry.getURL())); handler.handleDirEntry(dirEntry); } };
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { dirEntry.setLock((SVNLock) locksMap.get(dirEntry.getURL())); handler.handleDirEntry(dirEntry); } };
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { dirEntry.setLock((SVNLock) locksMap.get(dirEntry.getURL())); handler.handleDirEntry(dirEntry); } };
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { dirEntry.setLock((SVNLock) locksMap.get(dirEntry.getURL())); handler.handleDirEntry(dirEntry); } };
public Map<String, String> listEntries(String _path, String _asof, String _until) { Map<String, String> l = new HashMap<String, String>(); //String rel_path = url.toString().replace(rootRepo.getDir("", -1, null, (Collection<SVNDirEntry>)null).iterator().next(), ""); try { Collection<SVNDirEntry> entries = this.rootRepo.getDir(_path, -1, null,(Collection<SVNDirEntry>) null); //this.getDirEntries(path); Iterator<SVNDirEntry> iterator = entries.iterator(); String name = null, path = null; long rev = -1; // Use an iterator to get all directory entries in a certain path ("tags/") int asof = (_asof==null?-1:Integer.parseInt(_asof)); int until = (_until==null?-1:Integer.parseInt(_until)); while (iterator.hasNext()) { SVNDirEntry entry = (SVNDirEntry) iterator.next(); SvnClient.log.debug( "Path mess: " + entry.getPath() + " | " + entry.getRelativePath() + " | " + entry.getRepositoryRoot() + " | " + entry.getExternalParentUrl() + " | " + entry.getURL()); name = entry.getName(); rev = entry.getRevision(); path = entry.getURL().toString().substring(entry.getRepositoryRoot().toString().length()); if( asof<rev && (_until==null || rev<until) ) l.put(path, Long.toString(rev)); } } catch (Exception e) { SvnClient.log.error( "Error while getting directory entries: " + e.getMessage() ); } // return the tag name and the corresponding revision number return l; }
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { getOperation().receive(SvnTarget.fromURL(dirEntry.getURL()), dirEntry); } }
public void handleDirEntry(SVNDirEntry dirEntry) throws SVNException { getOperation().receive(SvnTarget.fromURL(dirEntry.getURL()), dirEntry); }
/** * Compares this object with another one. * * @param o an object to compare with * @return <ul> * <li>-1 - if <code>o</code> is either <span class="javakeyword">null</span>, * or is not an instance of <b>SVNDirEntry</b>, or this entry's URL is lexicographically * less than the name of <code>o</code>; * </li> * <li>1 - if this entry's URL is lexicographically greater than the name of <code>o</code>; * </li> * <li>0 - if and only if <code>o</code> has got the same URL as this one has * </li> * </ul> */ public int compareTo(Object o) { if (o == null || o.getClass() != SVNDirEntry.class) { return -1; } SVNNodeKind otherKind = ((SVNDirEntry) o).getKind(); if (otherKind != getKind()) { return getKind().compareTo(otherKind); } String otherURL = ((SVNDirEntry) o).getURL().toString(); return myURL.toString().compareTo(otherURL); } }
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()]); }
/** * Compares this object with another one. * * @param o an object to compare with * @return <ul> * <li>-1 - if <code>o</code> is either <span class="javakeyword">null</span>, * or is not an instance of <b>SVNDirEntry</b>, or this entry's URL is lexicographically * less than the name of <code>o</code>; * </li> * <li>1 - if this entry's URL is lexicographically greater than the name of <code>o</code>; * </li> * <li>0 - if and only if <code>o</code> has got the same URL as this one has * </li> * </ul> */ public int compareTo(Object o) { if (o == null || o.getClass() != SVNDirEntry.class) { return -1; } SVNNodeKind otherKind = ((SVNDirEntry) o).getKind(); if (otherKind != getKind()) { return getKind().compareTo(otherKind); } String otherURL = ((SVNDirEntry) o).getURL().toString(); return myURL.toString().compareTo(otherURL); } }
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()]); }
/** * Compares this object with another one. * * @param o an object to compare with * @return <ul> * <li>-1 - if <code>o</code> is either <span class="javakeyword">null</span>, * or is not an instance of <b>SVNDirEntry</b>, or this entry's URL is lexicographically * less than the name of <code>o</code>; * </li> * <li>1 - if this entry's URL is lexicographically greater than the name of <code>o</code>; * </li> * <li>0 - if and only if <code>o</code> has got the same URL as this one has * </li> * </ul> */ public int compareTo(Object o) { if (o == null || o.getClass() != SVNDirEntry.class) { return -1; } SVNNodeKind otherKind = ((SVNDirEntry) o).getKind(); if (otherKind != getKind()) { return getKind().compareTo(otherKind); } String otherURL = ((SVNDirEntry) o).getURL().toString(); return myURL.toString().compareTo(otherURL); } }
/** * Compares this object with another one. * * @param o an object to compare with * @return <ul> * <li>-1 - if <code>o</code> is either <span class="javakeyword">null</span>, * or is not an instance of <b>SVNDirEntry</b>, or this entry's URL is lexicographically * less than the name of <code>o</code>; * </li> * <li>1 - if this entry's URL is lexicographically greater than the name of <code>o</code>; * </li> * <li>0 - if and only if <code>o</code> has got the same URL as this one has * </li> * </ul> */ public int compareTo(Object o) { if (o == null || o.getClass() != SVNDirEntry.class) { return -1; } SVNNodeKind otherKind = ((SVNDirEntry) o).getKind(); if (otherKind != getKind()) { return getKind().compareTo(otherKind); } String otherURL = ((SVNDirEntry) o).getURL().toString(); return myURL.toString().compareTo(otherURL); } }
public SCMRepository info() { SVNRepository repository = null; try { SVNURL url = SVNURL.parseURIEncoded(path); repository = SVNRepositoryFactory.create(url); authenticateIfNecessary(repository); SVNDirEntry firstRevision = repository.info("/", 0); SVNDirEntry lastRevision = repository.info("/", SVNRevision.HEAD.getNumber()); return new SCMRepository(this, lastRevision.getURL().getPath(), path, String.valueOf(lastRevision.getRevision()), String.valueOf(firstRevision .getRevision())); } catch (SVNException e) { throw new RuntimeException("error in getHead() for " + path, e); } finally { if (repository != null) repository.closeSession(); } }
public static DirEntry createDirEntry(SVNDirEntry dirEntry) { if(dirEntry == null){ return null; } SVNURL url = dirEntry.getURL(); SVNURL repositoryRoot = dirEntry.getRepositoryRoot(); String relativeToRepositoryRoot = SVNPathUtil.getRelativePath(repositoryRoot.getPath(), url.getPath()); String relativeToTargetPath = dirEntry.getRelativePath(); String targetToRootPath = relativeToRepositoryRoot.substring(0, relativeToRepositoryRoot.length() - relativeToTargetPath.length()); return new DirEntry( relativeToTargetPath, SVNPathUtil.getAbsolutePath(targetToRootPath), getNodeKind(dirEntry.getKind()), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate() != null ? dirEntry.getDate().getTime()*1000 : 0, dirEntry.getAuthor() ); }
public static DirEntry createDirEntry(SVNDirEntry dirEntry) { if(dirEntry == null){ return null; } SVNURL url = dirEntry.getURL(); SVNURL repositoryRoot = dirEntry.getRepositoryRoot(); String relativeToRepositoryRoot = SVNPathUtil.getRelativePath(repositoryRoot.getPath(), url.getPath()); String relativeToTargetPath = dirEntry.getRelativePath(); String targetToRootPath = relativeToRepositoryRoot.substring(0, relativeToRepositoryRoot.length() - relativeToTargetPath.length()); return new DirEntry( relativeToTargetPath, SVNPathUtil.getAbsolutePath(targetToRootPath), getNodeKind(dirEntry.getKind()), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate() != null ? dirEntry.getDate().getTime()*1000 : 0, dirEntry.getAuthor() ); }
public static DirEntry createDirEntry(SVNDirEntry dirEntry) { if(dirEntry == null){ return null; } SVNURL url = dirEntry.getURL(); SVNURL repositoryRoot = dirEntry.getRepositoryRoot(); String relativeToRepositoryRoot = SVNPathUtil.getRelativePath(repositoryRoot.getPath(), url.getPath()); String relativeToTargetPath = dirEntry.getRelativePath(); String targetToRootPath = relativeToRepositoryRoot.substring(0, relativeToRepositoryRoot.length() - relativeToTargetPath.length()); return new DirEntry( relativeToTargetPath, SVNPathUtil.getAbsolutePath(targetToRootPath), getNodeKind(dirEntry.getKind()), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate() != null ? dirEntry.getDate().getTime()*1000 : 0, dirEntry.getAuthor() ); }
public static DirEntry createDirEntry(SVNDirEntry dirEntry) { if(dirEntry == null){ return null; } SVNURL url = dirEntry.getURL(); SVNURL repositoryRoot = dirEntry.getRepositoryRoot(); String relativeToRepositoryRoot = SVNPathUtil.getRelativePath(repositoryRoot.getPath(), url.getPath()); String relativeToTargetPath = dirEntry.getRelativePath(); String targetToRootPath = relativeToRepositoryRoot.substring(0, relativeToRepositoryRoot.length() - relativeToTargetPath.length()); return new DirEntry( relativeToTargetPath, SVNPathUtil.getAbsolutePath(targetToRootPath), getNodeKind(dirEntry.getKind()), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate() != null ? dirEntry.getDate().getTime()*1000 : 0, dirEntry.getAuthor() ); }
private DirEntry getDirEntry(SVNDirEntry dirEntry) { if (dirEntry == null) { return null; } String repositoryRootString = getUrlString(dirEntry.getRepositoryRoot()); String urlString = getUrlString(dirEntry.getURL()); String absolutePath = SVNPathUtil.getRelativePath(repositoryRootString, urlString); return new DirEntry(dirEntry.getRelativePath(), absolutePath, getNodeKind(dirEntry.getKind()), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), getLongDate(dirEntry.getDate()), dirEntry.getAuthor()); }