private String getRelativePath(String targetString, String baseTargetString) { final String pathAsChild = SVNPathUtil.getPathAsChild(baseTargetString, targetString); if (pathAsChild != null) { return pathAsChild; } if (targetString.equals(baseTargetString)) { return ""; } return null; }
public static String getRelativePath(String parent, String child) { parent = parent.replace(File.separatorChar, '/'); child = child.replace(File.separatorChar, '/'); String relativePath = getPathAsChild(parent, child); return relativePath == null ? "" : relativePath; }
public static String getRelativePath(String parent, String child) { parent = parent.replace(File.separatorChar, '/'); child = child.replace(File.separatorChar, '/'); String relativePath = getPathAsChild(parent, child); return relativePath == null ? "" : relativePath; }
public static String getRelativePath(String parent, String child) { parent = parent.replace(File.separatorChar, '/'); child = child.replace(File.separatorChar, '/'); String relativePath = getPathAsChild(parent, child); return relativePath == null ? "" : relativePath; }
public static String isChild(String parentPath, String childPath) { if (childPath.equals(parentPath)) { return ""; } if ("".equals(parentPath)) { return childPath; } childPath = childPath.replace(File.separatorChar, '/'); parentPath = parentPath.replace(File.separatorChar, '/'); return SVNPathUtil.getPathAsChild(parentPath, childPath); }
public static boolean hasChildPaths(String path, Map locks) { for (Iterator paths = locks.keySet().iterator(); paths.hasNext();) { String lockPath = (String) paths.next(); if (SVNPathUtil.getPathAsChild(path, lockPath) != null) { return true; } } return false; }
public static boolean hasChildPaths(String path, Map locks) { for (Iterator paths = locks.keySet().iterator(); paths.hasNext();) { String lockPath = (String) paths.next(); if (SVNPathUtil.getPathAsChild(path, lockPath) != null) { return true; } } return false; }
public static boolean hasChildPaths(String path, Map locks) { for (Iterator paths = locks.keySet().iterator(); paths.hasNext();) { String lockPath = (String) paths.next(); if (SVNPathUtil.getPathAsChild(path, lockPath) != null) { return true; } } return false; }
private void inheritImplicitMergeinfoFromParent(MergePath parent, MergePath child, long revision1, long revision2, SVNRepository repository) throws SVNException { if (parent.implicitMergeInfo == null) { Map[] mergeinfo = getFullMergeInfo(false, true, null, SVNMergeInfoInheritance.INHERITED, repository, parent.absPath, Math.max(revision1, revision2), Math.min(revision1, revision2)); parent.implicitMergeInfo = mergeinfo[1]; } child.implicitMergeInfo = new TreeMap<String, SVNMergeRangeList>(); String ancestorPath = SVNPathUtil.getCommonPathAncestor(parent.absPath.getAbsolutePath().replace(File.separatorChar, '/'), child.absPath.getAbsolutePath().replace(File.separatorChar, '/')); String childPath = SVNPathUtil.getPathAsChild(ancestorPath, child.absPath.getAbsolutePath().replace(File.separatorChar, '/')); if (childPath.startsWith("/")) { childPath = childPath.substring(1); } SVNMergeInfoUtil.adjustMergeInfoSourcePaths(child.implicitMergeInfo, childPath, parent.implicitMergeInfo); }
protected String getRelativePath(String origPath) { if (myRepositoryRoot == null) { assert !hasHttpV2Support(); throw new UnsupportedOperationException(); } String rootPath = myRepositoryRoot.getURIEncodedPath(); return SVNPathUtil.getPathAsChild(rootPath, origPath); }
private void inheritImplicitMergeinfoFromParent(MergePath parent, MergePath child, long revision1, long revision2, SVNRepository repository) throws SVNException { if (parent.myImplicitMergeInfo == null) { SVNEntry entry = myWCAccess.getEntry(parent.myPath, false); Map[] mergeinfo = getFullMergeInfo(entry, false, true, null, SVNMergeInfoInheritance.INHERITED, repository, parent.myPath, Math.max(revision1, revision2), Math.min(revision1, revision2)); parent.myImplicitMergeInfo = mergeinfo[1]; } child.myImplicitMergeInfo = new TreeMap(); String ancestorPath = SVNPathUtil.getCommonPathAncestor(parent.myPath.getAbsolutePath().replace(File.separatorChar, '/'), child.myPath.getAbsolutePath().replace(File.separatorChar, '/')); String childPath = SVNPathUtil.getPathAsChild(ancestorPath, child.myPath.getAbsolutePath().replace(File.separatorChar, '/')); if (childPath.startsWith("/")) { childPath = childPath.substring(1); } SVNMergeInfoUtil.adjustMergeInfoSourcePaths(child.myImplicitMergeInfo, childPath, parent.myImplicitMergeInfo); }
public static String getRelativeURL(SVNURL parent, SVNURL child) { String parentURLAsString = parent.toString(); String childURLAsString = child.toString(); String relativePath = SVNPathUtil.getPathAsChild(parentURLAsString, childURLAsString); return relativePath == null ? "" : relativePath; }
public static String getRelativeURL(SVNURL parent, SVNURL child) { String parentURLAsString = parent.toString(); String childURLAsString = child.toString(); String relativePath = SVNPathUtil.getPathAsChild(parentURLAsString, childURLAsString); return relativePath == null ? "" : relativePath; }
private String mapToReposRelPath(String pathOrUrl) { if (SVNPathUtil.isURL(pathOrUrl)) { return SVNPathUtil.getPathAsChild(SVNEncodingUtil.uriDecode(pathOrUrl), repositoryRoot.toDecodedString()); } else { return SVNPathUtil.append(baseRelPath, pathOrUrl.startsWith("/") ? pathOrUrl.substring("/".length()) : pathOrUrl); } }
public void linkPath(SVNURL url, String path, String lockToken, long revision, SVNDepth depth, boolean startEmpty) throws SVNException { SVNURL rootURL = SVNURLUtil.getCommonURLAncestor(url, myRepositoryLocation); if (SVNPathUtil.getPathAsChild(rootURL.getPath(), myRepositoryLocation.getPath()) != null) { myRepositoryLocation = rootURL; } myReporter.linkPath(url, path, lockToken, revision, depth, startEmpty); }
public static String getRelativeURL(SVNURL parent, SVNURL child, boolean encoded) { String parentURLAsString = encoded ? parent.toString() : parent.toDecodedString(); String childURLAsString = encoded ? child.toString() : child.toDecodedString(); String relativePath = SVNPathUtil.getPathAsChild(parentURLAsString, childURLAsString); return relativePath == null ? "" : relativePath; }
public String getReposRelativePath(String urlString) throws ClientException { try { final SVNURL url = SVNURL.parseURIEncoded(urlString); final SVNURL repositoryRoot = svnRepository.getRepositoryRoot(false); return SVNPathUtil.getPathAsChild(repositoryRoot.getPath(), url.getPath()); } catch (SVNException e) { throw ClientException.fromException(e); } }
public String getSessionRelativePath(String urlString) throws ClientException { try { final SVNURL url = SVNURL.parseURIEncoded(urlString); return SVNPathUtil.getPathAsChild(svnRepository.getLocation().getPath(), url.getPath()); } catch (SVNException e) { throw ClientException.fromException(e); } }
public void linkPath(SVNURL url, String path, String lockToken, long revision, SVNDepth depth, boolean startEmpty) throws SVNException { SVNURL rootURL = SVNURLUtil.getCommonURLAncestor(url, myCommonAncestorLocation); if (rootURL == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_URL, "Can not determine common ancestor of ''{0}'' and ''{1}'';\nprobably these entries belong to different repositories.", new Object[] {url, myCommonAncestorLocation}); SVNErrorManager.error(err, SVNLogType.WC); } if (SVNPathUtil.getPathAsChild(rootURL.getPath(), myCommonAncestorLocation.getPath()) != null) { myCommonAncestorLocation = rootURL; } myReporter.linkPath(url, path, lockToken, revision, depth, startEmpty); }
public void linkPath(SVNURL url, String path, String lockToken, long revision, SVNDepth depth, boolean startEmpty) throws SVNException { SVNURL rootURL = SVNURLUtil.getCommonURLAncestor(url, myRepositoryLocation); if (rootURL == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.BAD_URL, "Can not determine common ancestor of ''{0}'' and ''{1}'';\nprobably these entries belong to different repositories.", new Object[] {url, myRepositoryLocation}); SVNErrorManager.error(err, SVNLogType.WC); } if (SVNPathUtil.getPathAsChild(rootURL.getPath(), myRepositoryLocation.getPath()) != null) { myRepositoryLocation = rootURL; } myReporter.linkPath(url, path, lockToken, revision, depth, startEmpty); }