public Object run(SqlJetDb db) throws SqlJetException { try { SVNFileUtil.copyFile(srcRevPropDb, dstRevPropDb,true); } catch (SVNException e) { return e; } return null; } });
public static void copyFile(File src, File dst, boolean safe) throws SVNException { copyFile(src, dst, safe, true); }
private void createRepositoryLayout(File srcPath, File dstPath) throws SVNException { File[] children = srcPath.listFiles(); for (int i = 0; i < children.length; i++) { File child = children[i]; String childName = child.getName(); if (childName.equals(FSFS.DB_DIR) || childName.equals(FSFS.LOCKS_DIR) || childName.equals(FSFS.REPOS_FORMAT_FILE)) { continue; } File dstChildPath = new File(dstPath, childName); if (child.isDirectory()) { createReposDir(dstChildPath); createRepositoryLayout(child, dstChildPath); } else if (child.isFile()) { SVNFileUtil.copyFile(child, dstChildPath, true); } } }
private void createRepositoryLayout(File srcPath, File dstPath) throws SVNException { File[] children = srcPath.listFiles(); for (int i = 0; i < children.length; i++) { File child = children[i]; String childName = child.getName(); if (childName.equals(FSFS.DB_DIR) || childName.equals(FSFS.LOCKS_DIR) || childName.equals(FSFS.REPOS_FORMAT_FILE)) { continue; } File dstChildPath = new File(dstPath, childName); if (child.isDirectory()) { createReposDir(dstChildPath); createRepositoryLayout(child, dstChildPath); } else if (child.isFile()) { SVNFileUtil.copyFile(child, dstChildPath, true); } } }
private void createRepositoryLayout(File srcPath, File dstPath) throws SVNException { File[] children = srcPath.listFiles(); for (int i = 0; i < children.length; i++) { File child = children[i]; String childName = child.getName(); if (childName.equals(FSFS.DB_DIR) || childName.equals(FSFS.LOCKS_DIR) || childName.equals(FSFS.REPOS_FORMAT_FILE)) { continue; } File dstChildPath = new File(dstPath, childName); if (child.isDirectory()) { createReposDir(dstChildPath); createRepositoryLayout(child, dstChildPath); } else if (child.isFile()) { SVNFileUtil.copyFile(child, dstChildPath, true); } } }
private void copyAddedFileAdm(File src, SVNWCAccess srcAccess, SVNWCAccess dstAccess, File dstParent, String dstName, boolean isAdded) throws SVNException { File dst = new File(dstParent, dstName); SVNFileUtil.copyFile(src, dst, false); if (isAdded) { SVNWCManager.add(dst, dstAccess.getAdminArea(dstParent), null, SVNRepository.INVALID_REVISION, SVNDepth.INFINITY); copyProps(src, dst, srcAccess, dstAccess); } }
/** * Returns the base file path. * * <p/> * If the {@link #getBaseFile() base file} is located under the * {@link #getAdminArea() admin area}, then the return path will be just a relevant to the admin area path * of the base file. Otherwise (in case the repository file is located not under the admin area) this * method will create a temporary file in the <code>.svn/tmp</code> area of the admin area and copy the * contents of the base file into it; the return path will be again relative to the location of * the admin area. * * @return path of the file with pristine contents * @throws SVNException */ public String getBasePath() throws SVNException { if (myBaseFilePath == null && myBaseFile != null) { File tmp = SVNAdminUtil.createTmpFile(myAdminArea); SVNFileUtil.copyFile(myBaseFile, tmp, false); myBaseFilePath = SVNFileUtil.getBasePath(tmp); myTmpPaths.add(myBaseFilePath); } return myBaseFilePath; }
/** * Returns the path to the file containing the contents of the repository version of the file. * * <p/> * If the {@link #getRepositoryFile() repository file} is located under the * {@link #getAdminArea() admin area}, then the return path will be just a relevant to the admin area path * of the repository file. Otherwise (in case the repository file is located not under the admin area) this * method will create a temporary file in the <code>.svn/tmp</code> area of the admin area and copy the * contents of the repository file into it; the return path will be again relative to the location of * the admin area. * * @return path of the file containing file contents that come from the repository * @throws SVNException */ public String getRepositoryPath() throws SVNException { if (myRepositoryFilePath == null && myRepositoryFile != null) { File tmp = SVNAdminUtil.createTmpFile(myAdminArea); SVNFileUtil.copyFile(myRepositoryFile, tmp, false); myRepositoryFilePath = SVNFileUtil.getBasePath(tmp); myTmpPaths.add(myRepositoryFilePath); } return myRepositoryFilePath; }
/** * Returns the path to the file containing the contents of the repository version of the file. * * <p/> * If the {@link #getRepositoryFile() repository file} is located under the * {@link #getAdminArea() admin area}, then the return path will be just a relevant to the admin area path * of the repository file. Otherwise (in case the repository file is located not under the admin area) this * method will create a temporary file in the <code>.svn/tmp</code> area of the admin area and copy the * contents of the repository file into it; the return path will be again relative to the location of * the admin area. * * @return path of the file containing file contents that come from the repository * @throws SVNException */ public String getRepositoryPath() throws SVNException { if (myRepositoryFilePath == null && myRepositoryFile != null) { File tmp = SVNAdminUtil.createTmpFile(myAdminArea); SVNFileUtil.copyFile(myRepositoryFile, tmp, false); myRepositoryFilePath = SVNFileUtil.getBasePath(tmp); myTmpPaths.add(myRepositoryFilePath); } return myRepositoryFilePath; }
/** * Returns the base file path. * * <p/> * If the {@link #getBaseFile() base file} is located under the * {@link #getAdminArea() admin area}, then the return path will be just a relevant to the admin area path * of the base file. Otherwise (in case the repository file is located not under the admin area) this * method will create a temporary file in the <code>.svn/tmp</code> area of the admin area and copy the * contents of the base file into it; the return path will be again relative to the location of * the admin area. * * @return path of the file with pristine contents * @throws SVNException */ public String getBasePath() throws SVNException { if (myBaseFilePath == null && myBaseFile != null) { File tmp = SVNAdminUtil.createTmpFile(myAdminArea); SVNFileUtil.copyFile(myBaseFile, tmp, false); myBaseFilePath = SVNFileUtil.getBasePath(tmp); myTmpPaths.add(myBaseFilePath); } return myBaseFilePath; }
/** * Returns the path to the file containing the contents of the repository version of the file. * * <p/> * If the {@link #getRepositoryFile() repository file} is located under the * {@link #getAdminArea() admin area}, then the return path will be just a relevant to the admin area path * of the repository file. Otherwise (in case the repository file is located not under the admin area) this * method will create a temporary file in the <code>.svn/tmp</code> area of the admin area and copy the * contents of the repository file into it; the return path will be again relative to the location of * the admin area. * * @return path of the file containing file contents that come from the repository * @throws SVNException */ public String getRepositoryPath() throws SVNException { if (myRepositoryFilePath == null && myRepositoryFile != null) { File tmp = SVNAdminUtil.createTmpFile(myAdminArea); SVNFileUtil.copyFile(myRepositoryFile, tmp, false); myRepositoryFilePath = SVNFileUtil.getBasePath(tmp); myTmpPaths.add(myRepositoryFilePath); } return myRepositoryFilePath; }
public static void copy(File src, File dst, boolean safe, boolean copyAdminDirectories) throws SVNException { SVNFileType srcType = SVNFileType.getType(src); if (srcType == SVNFileType.FILE) { copyFile(src, dst, safe); } else if (srcType == SVNFileType.DIRECTORY) { copyDirectory(src, dst, copyAdminDirectories, null); } else if (srcType == SVNFileType.SYMLINK) { String name = SVNFileUtil.getSymlinkName(src); if (name != null) { SVNFileUtil.createSymlink(dst, name); } } }
public static void copy(File src, File dst, boolean safe, boolean copyAdminDirectories) throws SVNException { SVNFileType srcType = SVNFileType.getType(src); if (srcType == SVNFileType.FILE) { copyFile(src, dst, safe); } else if (srcType == SVNFileType.DIRECTORY) { copyDirectory(src, dst, copyAdminDirectories, null); } else if (srcType == SVNFileType.SYMLINK) { String name = SVNFileUtil.getSymlinkName(src); if (name != null) { SVNFileUtil.createSymlink(dst, name); } } }
public static void copy(File src, File dst, boolean safe, boolean copyAdminDirectories) throws SVNException { SVNFileType srcType = SVNFileType.getType(src); if (srcType == SVNFileType.FILE) { copyFile(src, dst, safe); } else if (srcType == SVNFileType.DIRECTORY) { copyDirectory(src, dst, copyAdminDirectories, null); } else if (srcType == SVNFileType.SYMLINK) { String name = SVNFileUtil.getSymlinkName(src); if (name != null) { SVNFileUtil.createSymlink(dst, name); } } }
public static void copy(File src, File dst, boolean safe, boolean copyAdminDirectories) throws SVNException { SVNFileType srcType = SVNFileType.getType(src); if (srcType == SVNFileType.FILE) { copyFile(src, dst, safe); } else if (srcType == SVNFileType.DIRECTORY) { copyDirectory(src, dst, copyAdminDirectories, null); } else if (srcType == SVNFileType.SYMLINK) { String name = SVNFileUtil.getSymlinkName(src); if (name != null) { SVNFileUtil.createSymlink(dst, name); } } }
private void copyAddedFileAdm(File src, SVNWCAccess srcAccess, SVNWCAccess dstAccess, File dstParent, String dstName, boolean isAdded) throws SVNException { File dst = new File(dstParent, dstName); SVNFileType srcType = SVNFileType.getType(src); if (srcType == SVNFileType.SYMLINK) { String linkName = SVNFileUtil.getSymlinkName(src); SVNFileUtil.createSymlink(dst, linkName); } else { SVNFileUtil.copyFile(src, dst, false); } if (isAdded) { SVNWCManager.add(dst, dstAccess.getAdminArea(dstParent), null, SVNRepository.INVALID_REVISION, SVNDepth.INFINITY); copyProps(src, dst, srcAccess, dstAccess); } }
private void copyAddedFileAdm(File src, SVNWCAccess srcAccess, SVNWCAccess dstAccess, File dstParent, String dstName, boolean isAdded) throws SVNException { File dst = new File(dstParent, dstName); SVNFileType srcType = SVNFileType.getType(src); if (srcType == SVNFileType.SYMLINK) { String linkName = SVNFileUtil.getSymlinkName(src); SVNFileUtil.createSymlink(dst, linkName); } else { SVNFileUtil.copyFile(src, dst, false); } if (isAdded) { SVNWCManager.add(dst, dstAccess.getAdminArea(dstParent), null, SVNRepository.INVALID_REVISION, SVNDepth.INFINITY); copyProps(src, dst, srcAccess, dstAccess); } }
public void copyTo(SVNProperties destination) throws SVNException { if (isEmpty()) { SVNFileUtil.deleteFile(destination.getFile()); } else { SVNFileUtil.copyFile(getFile(), destination.getFile(), true); } }
public void writeOutRejectedHunks(boolean dryRun) throws SVNException { try { getRejectStream().close(); } catch (IOException e) { SVNErrorMessage errorMessage = SVNErrorMessage.create(SVNErrorCode.IO_ERROR, e); SVNErrorManager.error(errorMessage, SVNLogType.WC); } if (!dryRun && (hadRejects() || hadPropRejects())) { SVNFileUtil.copyFile(getRejectAbsPath(), SVNFileUtil.createFilePath(SVNFileUtil.getFilePath(getAbsPath()) + ".svnpatch.rej"), false); } }
protected SVNMergeResult handleMarkBinaryConflicted(SVNMergeFileSet files) throws SVNException { SVNProperties command = new SVNProperties(); File root = files.getAdminArea().getRoot(); SVNLog log = files.getLog(); File oldFile = SVNFileUtil.createUniqueFile(root, files.getWCPath(), files.getBaseLabel(), false); File newFile = SVNFileUtil.createUniqueFile(root, files.getWCPath(), files.getRepositoryLabel(), false); SVNFileUtil.copyFile(files.getBaseFile(), oldFile, false); SVNFileUtil.copyFile(files.getRepositoryFile(), newFile, false); if (!files.getLocalPath().equals(files.getWCPath())) { File mineFile = SVNFileUtil.createUniqueFile(root, files.getWCPath(), files.getLocalLabel(), false); String minePath = SVNFileUtil.getBasePath(mineFile); command.put(SVNLog.NAME_ATTR, files.getLocalPath()); command.put(SVNLog.DEST_ATTR, minePath); log.addCommand(SVNLog.MOVE, command, false); command.clear(); command.put(SVNProperty.shortPropertyName(SVNProperty.CONFLICT_WRK), minePath); } else { command.put(SVNProperty.shortPropertyName(SVNProperty.CONFLICT_WRK), ""); } String newPath = SVNFileUtil.getBasePath(newFile); String oldPath = SVNFileUtil.getBasePath(oldFile); makeBinaryConflictEntry(files, newPath, oldPath); return SVNMergeResult.createMergeResult(SVNStatusType.CONFLICTED, null); }