String rootPath = repos.getRepositoryRoot().getPath(); String fullPath = SVNURL.parse(url).getPath();
String rootPath = SVNEncodingUtil.uriEncode(repos.getRepositoryRoot().getPath()); String fullPath = SVNEncodingUtil.uriEncode(SVNURL.parse(url).getPath());
    public String getURL(String url, SVNRevision peg, SVNRevision rev)            throws SVNException {        if (rev == null || !rev.isValid()) {            rev = SVNRevision.HEAD;        }        if (rev.equals(peg)) {            return url;        }        if (peg == null || !peg.isValid()) {            return url;        }        SVNRepository repos = createRepository(url);        long pegRevNumber = getRevisionNumber(url, peg);        long revNumber = getRevisionNumber(url, rev);        List locations = new ArrayList(1);        try {            locations = (List) repos.getLocations("", locations, pegRevNumber,                    new long[] { revNumber });        } catch (SVNException e) {            DebugLog.error(e);            SVNErrorManager                    .error("svn: Unable to find repository location for '"                            + url + "' in revision " + revNumber);            return null;        }        if (locations == null || locations.size() != 1) {            SVNErrorManager                    .error("svn: Unable to find repository location for '"                            + url + "' in revision " + revNumber);            return null;        }        SVNLocationEntry location = (SVNLocationEntry) locations.get(0);        String path = SVNEncodingUtil.uriEncode(location.getPath());        String rootPath = repos.getRepositoryRoot().getPath();        String fullPath = SVNURL.parse(url).getPath();        url = url.substring(0, url.length() - fullPath.length());        url = SVNPathUtil.append(url, rootPath);        url = SVNPathUtil.append(url, path);        return url;    }