if (peg.equals(rev) || !peg.isValid()) {
if (!rev.isValid()) { rev = SVNRevision.HEAD; } if (rev.equals(peg)) { return url; } if (!peg.isValid()) {
    protected String getURL(String url, SVNRevision peg, SVNRevision rev) throws SVNException {        if (peg.equals(rev) || !peg.isValid()) {            return url;        }        SVNRepository repos = myRepositoryFactory.createRepository(url);                long pegRevNumber = getRevisionNumber(url, peg);        long revNumber = getRevisionNumber(url, rev);        List locations = (List) repos.getLocations("", new ArrayList(1), pegRevNumber, new long[] {revNumber});        if (locations == null || locations.size() != 1) {            return url;        }        SVNLocationEntry location = (SVNLocationEntry) locations.get(0);        String path = location.getPath();        String rootPath = repos.getRepositoryRoot();        String fullPath = SVNRepositoryLocation.parseURL(url).getPath();        url = url.substring(0, url.length() - fullPath.length());        url = PathUtil.append(url, rootPath);        url = PathUtil.append(url, path);        return url;    }