public void doEntry(DirEntry dirent, Lock lock) { // All of this is meant to retain backward compatibility with // the old svn_client_ls-style API. For further information about // what is going on here, see the comments in // libsvn_client/list.c:store_dirent(). if (dirent.getPath().length() == 0) { if (dirent.getNodeKind() == NodeKind.file) { String absPath = dirent.getAbsPath(); int lastSeparator = absPath.lastIndexOf('/'); String path = absPath.substring(lastSeparator, absPath.length()); dirent.setPath(path); } else { // It's the requested directory, which we don't want // to add. return; } } dirents.add(dirent); }
/** * @return The path at its last changed revision. */ public String toString() { return getPath() + '@' + getLastChangedRevision(); } }
String name = basePath + tested[i].getPath(); Item item = (Item) items.get(name); Assert.assertNotNull("null paths won't be found in working copy", tested[i].getNodeKind(), item.nodeKind == -1 ? NodeKind.file : item.nodeKind); tested[i].getNodeKind(), item.nodeKind == -1 ? NodeKind.dir : item.nodeKind); for (int i = 0; i < tested.length; i++) if (tested[i].getNodeKind() == NodeKind.dir) tested[i].getPath()))
public static DirEntry createDirEntry(SVNDirEntry dirEntry) { if(dirEntry == null){ return null; } return new DirEntry( dirEntry.getRelativePath(), getNodeKind(dirEntry.getKind()), dirEntry.getSize(), dirEntry.hasProperties(), dirEntry.getRevision(), dirEntry.getDate() != null ? dirEntry.getDate().getTime()*1000 : 0, dirEntry.getAuthor() ); }
/** * Check the result of a single file SVNClient.list call * @param tested the result array * @param singleFilePath the path to be checked * @throws Exception */ void check(DirEntry[] tested, String singleFilePath) { Assert.assertEquals("not a single dir entry", 1, tested.length); Item item = (Item)items.get(singleFilePath); Assert.assertNotNull("not found in working copy", item); Assert.assertNotNull("not a file", item.myContent); Assert.assertEquals("state says file, working copy not", tested[0].getNodeKind(), item.nodeKind == -1 ? NodeKind.file : item.nodeKind); }
/** * @return The path at its last changed revision. */ public String toString() { return getPath() + '@' + getLastChangedRevision(); } }
String name = basePath + tested[i].getPath(); Item item = (Item) items.get(name); Assert.assertNotNull("null paths won't be found in working copy", tested[i].getNodeKind(), item.nodeKind == -1 ? NodeKind.file : item.nodeKind); tested[i].getNodeKind(), item.nodeKind == -1 ? NodeKind.dir : item.nodeKind); for (int i = 0; i < tested.length; i++) if (tested[i].getNodeKind() == NodeKind.dir) tested[i].getPath()))
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() ); }
/** * Check the result of a single file SVNClient.list call * @param tested the result array * @param singleFilePath the path to be checked * @throws Exception */ void check(DirEntry[] tested, String singleFilePath) { Assert.assertEquals("not a single dir entry", 1, tested.length); Item item = (Item)items.get(singleFilePath); Assert.assertNotNull("not found in working copy", item); Assert.assertNotNull("not a file", item.myContent); Assert.assertEquals("state says file, working copy not", tested[0].getNodeKind(), item.nodeKind == -1 ? NodeKind.file : item.nodeKind); }
public void doEntry(DirEntry dirent, Lock lock) { // All of this is meant to retain backward compatibility with // the old svn_client_ls-style API. For further information about // what is going on here, see the comments in // libsvn_client/list.c:store_dirent(). if (dirent.getPath().length() == 0) { if (dirent.getNodeKind() == NodeKind.file) { String absPath = dirent.getAbsPath(); int lastSeparator = absPath.lastIndexOf('/'); String path = absPath.substring(lastSeparator, absPath.length()); dirent.setPath(path); } else { // It's the requested directory, which we don't want // to add. return; } } dirents.add(dirent); }
/** * @return The path at its last changed revision. */ public String toString() { return getPath() + '@' + getLastChangedRevision(); } }
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() ); }
/** * @return The path at its last changed revision. */ public String toString() { return getPath() + '@' + getLastChangedRevision(); } }
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() ); }