public static File createFilePath(String parent, String child) { if (child == null) return null; if (parent == null || "".equals(parent)) return createFilePath(child); if (SVNPathUtil.isAbsolute(child)) return createFilePath(child); return new File(parent, child.toString()); }
public SVNRemoteStatusEditor17(File anchorAbsPath, String targetBaseName, SVNWCContext wcContext, ISVNOptions options, boolean includeIgnored, boolean reportAll, SVNDepth depth, boolean checkWorkingCopy, ISvnObjectReceiver<SvnStatus> realHandler) throws SVNException { super(SVNFileUtil.createFilePath(anchorAbsPath, targetBaseName), wcContext, options, includeIgnored, reportAll, depth, realHandler); myAnchorStatus = internalStatus(wcContext, anchorAbsPath, checkWorkingCopy); myIsCheckWorkingCopy = checkWorkingCopy; myAnchorAbsPath = anchorAbsPath; myTargetBaseName = targetBaseName; myTargetAbsPath = SVNFileUtil.createFilePath(anchorAbsPath, targetBaseName); collectExternals(myTargetAbsPath); }
public static File getColumnPath(SVNSqlJetStatement stmt, Enum<?> f) throws SVNException { String path = stmt.getColumnString(f); if (path != null) { return SVNFileUtil.createFilePath(path); } return null; }
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<String, Map<String, SVNMergeRangeList>> addPrefixToCatalog(Map<String, Map<String, SVNMergeRangeList>> catalog, File prefix) { Map<String, Map<String, SVNMergeRangeList>> result = new TreeMap<String, Map<String,SVNMergeRangeList>>(); for (String path : catalog.keySet()) { Map<String, SVNMergeRangeList> mi = catalog.get(path); if (path.startsWith("/")) { path = path.substring(1); } String prefixedPath = SVNFileUtil.getFilePath(SVNFileUtil.createFilePath(prefix, path)); result.put(prefixedPath, mi); } return result; }
public void dirOpened(SvnDiffCallbackResult result, File relPath, SvnDiffSource leftSource, SvnDiffSource rightSource, SvnDiffSource copyFromSource, Object dirBaton) throws SVNException { if (prefixRelPath != null) { relPath = SVNFileUtil.createFilePath(prefixRelPath, SVNFileUtil.getFilePath(relPath)); } delegate.dirOpened(result, relPath, rightSource, leftSource, null, dirBaton); }
public static File skipAncestor(File parent, File child) { if (!isAncestor(parent, child)) { return child; } return SVNFileUtil.createFilePath(getPathAsChild(parent, child)); }
private FileBaton makeFileBaton(String path, boolean added) { final FileBaton baton = new FileBaton(); baton.added = added; baton.repoPath = path; baton.wcPath = SVNFileUtil.createFilePath(target, path); baton.propChanges = new SVNProperties(); baton.baseRevision = this.revision; return baton; }
private static File pathTxnSha1(FSFS fsfs, FSRepresentation representation, String txnId) { final String checksum = representation.getSHA1HexDigest(); final File transactionDirectory = fsfs.getTransactionDir(txnId); return SVNFileUtil.createFilePath(transactionDirectory, checksum); } }
private static boolean isUnderRoot(File workingCopyDirectory, File relPath) throws SVNException { File fullPath = SVNFileUtil.createFilePath(workingCopyDirectory, relPath); try { String workingCopyDirectoryPath = SVNFileUtil.getFilePath(workingCopyDirectory.getCanonicalFile()); String canonicalFullPath = SVNFileUtil.getFilePath(fullPath.getCanonicalFile()); return canonicalFullPath.equals(workingCopyDirectoryPath) || SVNPathUtil.isAncestor(workingCopyDirectoryPath, canonicalFullPath); } catch (IOException e) { SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e); SVNErrorManager.error(errorMessage, SVNLogType.WC); } return false; }
public File toRelPath(File wriAbsPath, File localAbsPath) throws SVNException { assert isAbsolute(localAbsPath); DirParsedInfo parsed = parseDir(wriAbsPath, Mode.ReadOnly); File rootAbsPath = parsed.wcDbDir.getWCRoot().getAbsPath(); return SVNPathUtil.isAncestor(rootAbsPath.getPath(), localAbsPath.getPath()) ? SVNFileUtil.createFilePath(SVNPathUtil.getRelativePath(rootAbsPath.getPath(), localAbsPath.getPath())) : localAbsPath; }
public void absentFile(String path) throws SVNException { File file = SVNFileUtil.createFilePath(currentDir.wcPath, SVNPathUtil.tail(path)); SVNEvent event = SVNEventFactory.createSVNEvent(file, SVNNodeKind.FILE, null, -1, SVNStatusType.MISSING, SVNStatusType.MISSING, SVNStatusType.LOCK_INAPPLICABLE, SVNEventAction.SKIP, null, null, null, null); handleEvent(event); }
private void addChildren(Set<String> children, SVNSqlJetStatement stmt) throws SVNException { try { while (stmt.next()) { String child_relpath = getColumnText(stmt, SVNWCDbSchema.NODES__Fields.local_relpath); String name = SVNFileUtil.getFileName(SVNFileUtil.createFilePath(child_relpath)); children.add(name); } } finally { stmt.reset(); } }
public File getWCRootTempDir(File localAbspath) throws SVNException { assert (isAbsolute(localAbspath)); DirParsedInfo parseDir = parseDir(localAbspath, Mode.ReadWrite); SVNWCDbDir pdh = parseDir.wcDbDir; verifyDirUsable(pdh); return SVNFileUtil.createFilePath(SVNFileUtil.createFilePath(pdh.getWCRoot().getAbsPath(), SVNFileUtil.getAdminDirectoryName()), WCROOT_TEMPDIR_RELPATH); }
public File fromRelPath(File wriAbsPath, File localRelPath) throws SVNException { DirParsedInfo parsed = parseDir(wriAbsPath, Mode.ReadOnly); File wcRootAbsPath = parsed.wcDbDir.getWCRoot().getAbsPath(); return SVNFileUtil.createFilePath(wcRootAbsPath, localRelPath); }
public void deleteEntry(String path, long revision) throws SVNException { final File local_abspath = SVNFileUtil.createFilePath(myAnchorAbsPath, path); tweakStatusHash(myDirectoryInfo, new DirectoryInfo(path, myDirectoryInfo), local_abspath, SVNStatusType.STATUS_DELETED, SVNStatusType.STATUS_NONE, SVNStatusType.STATUS_NONE, SVNRevision.create(revision), null); if (myDirectoryInfo.parent != null && myTargetBaseName == null) tweakStatusHash(myDirectoryInfo.parent, myDirectoryInfo, myDirectoryInfo.localAbsPath, SVNStatusType.STATUS_MODIFIED, SVNStatusType.STATUS_MODIFIED, SVNStatusType.STATUS_NONE, null, null); }
public static File skipAncestor(File parent, File child) { String parentPath = SVNFileUtil.getFilePath(parent); String childPath = SVNFileUtil.getFilePath(child); if (SVNPathUtil.isAncestor(parentPath, childPath)) { return SVNFileUtil.createFilePath(SVNPathUtil.getRelativePath(parentPath, childPath)); } return null; }
public void openRoot(long revision) throws SVNException { DirectoryBaton db = new DirectoryBaton("", null, false, revision); db.leftSource = new SvnDiffSource(this.revision); db.rightSource = new SvnDiffSource(this.targetRevision); mergeResult.reset(); processor.dirOpened(mergeResult, SVNFileUtil.createFilePath(""), db.leftSource, db.rightSource, null, null); db.skip = mergeResult.skip; db.skipChildren = mergeResult.skipChildren; db.pdb = mergeResult.newBaton; this.currentDirectory = db; }
public void addFile(String path, String copyFromPath, long copyFromRevision) throws SVNException { currentFile = new FileBaton(currentDirectory); currentFile.localAbsPath = SVNFileUtil.createFilePath(anchorAbsPath, path); if (!SVNPathUtil.isAncestor(SVNFileUtil.getFilePath(anchorAbsPath), SVNFileUtil.getFilePath(currentFile.localAbsPath))) { SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.WC_OBSTRUCTED_UPDATE, "Path ''{0}'' is not in the working copy", path); SVNErrorManager.error(errorMessage, SVNLogType.WC); } }
public File requiredLockForResolve(File localAbsPath) throws SVNException { DirParsedInfo parsed = parseDir(localAbsPath, Mode.ReadOnly); SVNWCDbDir pdh = parsed.wcDbDir; verifyDirUsable(pdh); RequiredLockForResolve requiredLockForResolve = new RequiredLockForResolve(); requiredLockForResolve.wcRoot = pdh.getWCRoot(); requiredLockForResolve.localRelPath = parsed.localRelPath; pdh.getWCRoot().getSDb().runTransaction(requiredLockForResolve); return SVNFileUtil.createFilePath(pdh.getWCRoot().getAbsPath(), requiredLockForResolve.requiredRelPath); }