private File removeSuffix(File file, String suffix) { String fileName = SVNPathUtil.getAbsolutePath(file.getPath()); if (fileName.length() > suffix.length() && fileName.endsWith(suffix)) { return SVNFileUtil.createFilePath(fileName.substring(0, fileName.length() - suffix.length())); } return null; }
public static Map adjustMergeInfoSourcePaths(Map mergeInfo, String walkPath, Map wcMergeInfo) { mergeInfo = mergeInfo == null ? new TreeMap() : mergeInfo; for (Iterator paths = wcMergeInfo.keySet().iterator(); paths.hasNext();) { String srcMergePath = (String) paths.next(); SVNMergeRangeList rangeList = (SVNMergeRangeList) wcMergeInfo.get(srcMergePath); mergeInfo.put(SVNPathUtil.getAbsolutePath(SVNPathUtil.append(srcMergePath, walkPath)), rangeList); } return mergeInfo; }
public static Map<String, SVNMergeRangeList> adjustMergeInfoSourcePaths(Map<String, SVNMergeRangeList> mergeInfo, String walkPath, Map<String, SVNMergeRangeList> wcMergeInfo) { mergeInfo = mergeInfo == null ? new TreeMap<String, SVNMergeRangeList>() : mergeInfo; for (Iterator<String> paths = wcMergeInfo.keySet().iterator(); paths.hasNext();) { String srcMergePath = paths.next(); SVNMergeRangeList rangeList = (SVNMergeRangeList) wcMergeInfo.get(srcMergePath); mergeInfo.put(SVNPathUtil.getAbsolutePath(SVNPathUtil.append(srcMergePath, walkPath)), rangeList); } return mergeInfo; }
private Map prefixMergeInfoPaths(Map mergeInfo) { Map prefixedMergeInfo = new TreeMap(); for (Iterator mergeInfoIter = mergeInfo.keySet().iterator(); mergeInfoIter.hasNext();) { String mergeSource = (String) mergeInfoIter.next(); SVNMergeRangeList rangeList = (SVNMergeRangeList) mergeInfo.get(mergeSource); mergeSource = mergeSource.startsWith("/") ? mergeSource.substring(1) : mergeSource; String prefixedMergeSource = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myParentDir, mergeSource)); prefixedMergeInfo.put(prefixedMergeSource, rangeList); } return prefixedMergeInfo; }
public static Map adjustMergeInfoSourcePaths(Map mergeInfo, String walkPath, Map wcMergeInfo) { mergeInfo = mergeInfo == null ? new TreeMap() : mergeInfo; for (Iterator paths = wcMergeInfo.keySet().iterator(); paths.hasNext();) { String srcMergePath = (String) paths.next(); SVNMergeRangeList rangeList = (SVNMergeRangeList) wcMergeInfo.get(srcMergePath); mergeInfo.put(SVNPathUtil.getAbsolutePath(SVNPathUtil.append(srcMergePath, walkPath)), rangeList); } return mergeInfo; }
private DirectoryInfo createDirectoryInfo(String path, String copyFromPath, long copyFromRev, DirectoryInfo parent) { String fullPath = null; if (parent != null) { fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myRootPath, path)); } else { fullPath = myRootPath; } String cmpPath = null; if (copyFromPath != null) { cmpPath = copyFromPath.startsWith("/") ? copyFromPath.substring(1) : copyFromPath; } return new DirectoryInfo(fullPath, cmpPath, copyFromRev, parent); }
public String getAbsPath() throws SVNException { String pathSoFar = "/"; if (myParent != null) { pathSoFar = myParent.getAbsPath(); } return SVNPathUtil.getAbsolutePath(SVNPathUtil.append(pathSoFar, getEntryName())); }
public String getAbsPath() throws SVNException { String pathSoFar = "/"; if (myParent != null) { pathSoFar = myParent.getAbsPath(); } return SVNPathUtil.getAbsolutePath(SVNPathUtil.append(pathSoFar, getEntryName())); }
public String getAbsPath() throws SVNException { String pathSoFar = "/"; if (myParent != null) { pathSoFar = myParent.getAbsPath(); } return SVNPathUtil.getAbsolutePath(SVNPathUtil.append(pathSoFar, getEntryName())); }
public void changeFileProperty(String path, String name, SVNPropertyValue value) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); SVNProperties props = getFilePropertiesStorage(); if (!fullPath.equals(myCurrentFilePath)) { if (myCurrentFilePath != null) { changeNodeProperties(myCurrentFilePath, props); props.clear(); } myCurrentFilePath = fullPath; } props.put(name, value); }
public void openDir(String path, long revision) throws SVNException { DirBaton parentBaton = (DirBaton) myDirsStack.peek(); String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind == SVNNodeKind.NONE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Path ''{0}'' not present", path); SVNErrorManager.error(err, SVNLogType.FSFS); } DirBaton dirBaton = new DirBaton(revision, fullPath, parentBaton.isCopied()); myDirsStack.push(dirBaton); }
public void openDir(String path, long revision) throws SVNException { DirBaton parentBaton = (DirBaton) myDirsStack.peek(); String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind == SVNNodeKind.NONE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Path ''{0}'' not present", path); SVNErrorManager.error(err, SVNLogType.FSFS); } DirBaton dirBaton = new DirBaton(revision, fullPath, parentBaton.isCopied()); myDirsStack.push(dirBaton); }
public void openDir(String path, long revision) throws SVNException { DirBaton parentBaton = (DirBaton) myDirsStack.peek(); String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); SVNNodeKind kind = myTxnRoot.checkNodeKind(fullPath); if (kind == SVNNodeKind.NONE) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NOT_DIRECTORY, "Path ''{0}'' not present", path); SVNErrorManager.error(err, SVNLogType.FSFS); } DirBaton dirBaton = new DirBaton(revision, fullPath, parentBaton.isCopied()); myDirsStack.push(dirBaton); }
public void changeFileProperty(String path, String name, SVNPropertyValue value) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); SVNProperties props = getFilePropertiesStorage(); if (!fullPath.equals(myCurrentFilePath)) { if (myCurrentFilePath != null) { changeNodeProperties(myCurrentFilePath, props); props.clear(); } myCurrentFilePath = fullPath; } props.put(name, value); }
public void openFile(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); FSRevisionNode revNode = myTxnRoot.getRevisionNode(fullPath); if (FSRepository.isValidRevision(revision) && revision < revNode.getCreatedRevision()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, SVNNodeKind.FILE), SVNLogType.FSFS); } }
public void openFile(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); FSRevisionNode revNode = myTxnRoot.getRevisionNode(fullPath); if (FSRepository.isValidRevision(revision) && revision < revNode.getCreatedRevision()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, SVNNodeKind.FILE), SVNLogType.FSFS); } }
public void openFile(String path, long revision) throws SVNException { String fullPath = SVNPathUtil.getAbsolutePath(SVNPathUtil.append(myBasePath, path)); FSRevisionNode revNode = myTxnRoot.getRevisionNode(fullPath); if (FSRepository.isValidRevision(revision) && revision < revNode.getCreatedRevision()) { SVNErrorManager.error(FSErrors.errorOutOfDate(fullPath, SVNNodeKind.FILE), SVNLogType.FSFS); } }
private SVNLocationEntry findRealBaseLocation(Node node) throws SVNException { if (node.myAction == SVNChangeEntry.TYPE_ADDED && node.myCopyFromPath != null && SVNRevision.isValidRevisionNumber(node.myCopyFromRevision)) { return new SVNLocationEntry(node.myCopyFromRevision, node.myCopyFromPath); } if (node.myParent != null) { SVNLocationEntry location = findRealBaseLocation(node.myParent); return new SVNLocationEntry(location.getRevision(), SVNPathUtil.getAbsolutePath(SVNPathUtil.append(location.getPath(), node.myName))); } return new SVNLocationEntry(-1, "/"); }
private SVNLocationEntry findRealBaseLocation(Node node) throws SVNException { if (node.myAction == SVNChangeEntry.TYPE_ADDED && node.myCopyFromPath != null && SVNRevision.isValidRevisionNumber(node.myCopyFromRevision)) { return new SVNLocationEntry(node.myCopyFromRevision, node.myCopyFromPath); } if (node.myParent != null) { SVNLocationEntry location = findRealBaseLocation(node.myParent); return new SVNLocationEntry(location.getRevision(), SVNPathUtil.getAbsolutePath(SVNPathUtil.append(location.getPath(), node.myName))); } return new SVNLocationEntry(-1, "/"); }
private SVNLocationEntry findRealBaseLocation(Node node) throws SVNException { if (node.myAction == SVNChangeEntry.TYPE_ADDED && node.myCopyFromPath != null && SVNRevision.isValidRevisionNumber(node.myCopyFromRevision)) { return new SVNLocationEntry(node.myCopyFromRevision, node.myCopyFromPath); } if (node.myParent != null) { SVNLocationEntry location = findRealBaseLocation(node.myParent); return new SVNLocationEntry(location.getRevision(), SVNPathUtil.getAbsolutePath(SVNPathUtil.append(location.getPath(), node.myName))); } return new SVNLocationEntry(-1, "/"); }