public static String runPreLockHook(File reposRootDir, String path, String username, String comment, boolean stealLock) throws SVNException { username = username == null ? "" : username; path = path == null ? "" : path; return runHook(reposRootDir, SVN_REPOS_HOOK_PRE_LOCK, new String[] {path, username, comment != null ? comment : "", stealLock ? "1" : "0"}, null); }
public static void runPreCommitHook(File reposRootDir, String txnName) throws SVNException { runHook(reposRootDir, SVN_REPOS_HOOK_PRE_COMMIT, new String[] {txnName}, null); }
public static void runPreCommitHook(File reposRootDir, String txnName) throws SVNException { runHook(reposRootDir, SVN_REPOS_HOOK_PRE_COMMIT, new String[] {txnName}, null); }
public static void runPreCommitHook(File reposRootDir, String txnName) throws SVNException { runHook(reposRootDir, SVN_REPOS_HOOK_PRE_COMMIT, new String[] {txnName}, null); }
public static void runPostCommitHook(File reposRootDir, long committedRevision) throws SVNException { runHook(reposRootDir, SVN_REPOS_HOOK_POST_COMMIT, new String[] {String.valueOf(committedRevision)}, null); }
public static void runPostCommitHook(File reposRootDir, long committedRevision) throws SVNException { runHook(reposRootDir, SVN_REPOS_HOOK_POST_COMMIT, new String[] {String.valueOf(committedRevision)}, null); }
public static void runPostCommitHook(File reposRootDir, long committedRevision) throws SVNException { runHook(reposRootDir, SVN_REPOS_HOOK_POST_COMMIT, new String[] {String.valueOf(committedRevision)}, null); }
private static void runLockHook(File reposRootDir, String hookName, String path, String username, String paths) throws SVNException { username = username == null ? "" : username; path = path == null ? "" : path; byte[] bytes = null; try { bytes = paths == null ? null : paths.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { bytes = paths.getBytes(); } runHook(reposRootDir, hookName, new String[] {path, username}, bytes); }
private static void runLockHook(File reposRootDir, String hookName, String path, String username, String paths) throws SVNException { username = username == null ? "" : username; path = path == null ? "" : path; byte[] bytes = null; try { bytes = paths == null ? null : paths.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { bytes = paths.getBytes(); } runHook(reposRootDir, hookName, new String[] {path, username}, bytes); }
private static void runLockHook(File reposRootDir, String hookName, String path, String username, String paths) throws SVNException { username = username == null ? "" : username; path = path == null ? "" : path; byte[] bytes = null; try { bytes = paths == null ? null : paths.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { bytes = paths.getBytes(); } runHook(reposRootDir, hookName, new String[] {path, username}, bytes); }
public static void runStartCommitHook(File reposRootDir, String author, List<?> capabilities) throws SVNException { author = author == null ? "" : author; String capsString = getCapabilitiesAsString(capabilities); String[] args = capsString == null ? new String[] { author } : new String[] { author, capsString }; runHook(reposRootDir, SVN_REPOS_HOOK_START_COMMIT, args, null); }
public static void runStartCommitHook(File reposRootDir, String author, List capabilities) throws SVNException { author = author == null ? "" : author; String capsString = getCapabilitiesAsString(capabilities); String[] args = capsString == null ? new String[] { author } : new String[] { author, capsString }; runHook(reposRootDir, SVN_REPOS_HOOK_START_COMMIT, args, null); }
public static void runStartCommitHook(File reposRootDir, String author, List capabilities) throws SVNException { author = author == null ? "" : author; String capsString = getCapabilitiesAsString(capabilities); String[] args = capsString == null ? new String[] { author } : new String[] { author, capsString }; runHook(reposRootDir, SVN_REPOS_HOOK_START_COMMIT, args, null); }
private static void runChangeRevPropHook(File reposRootDir, String hookName, String propName, byte[] propValue, String author, long revision, String action, boolean isPre) throws SVNException { File hookFile = getHookFile(reposRootDir, hookName); if (hookFile == null) { if (isPre) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_DISABLED_FEATURE, "Repository has not been enabled to accept revision propchanges;\nask the administrator to create a pre-revprop-change hook"); SVNErrorManager.error(err, SVNLogType.FSFS); } return; } author = author == null ? "" : author; runHook(reposRootDir, hookName, new String[] {String.valueOf(revision), author, propName, action}, propValue); }
private static void runCommitHook(File reposRootDir, String hookName, String secondArg, boolean readErrorStream) throws SVNException { File hookFile = getHookFile(reposRootDir, hookName); if (hookFile == null) { return; } Process hookProc = null; String reposPath = reposRootDir.getAbsolutePath().replace(File.separatorChar, '/'); try { String executableName = hookFile.getName().toLowerCase(); if ((executableName.endsWith(".bat") || executableName.endsWith(".cmd")) && SVNFileUtil.isWindows) { String cmd = "cmd /C \"" + "\"" + hookFile.getAbsolutePath() + "\" " + "\"" + reposPath + "\" " + "\"" + secondArg + "\""; hookProc = Runtime.getRuntime().exec(cmd); } else { String[] cmd = { hookFile.getAbsolutePath(), reposPath, secondArg != null && !"".equals(secondArg) ? secondArg : "\"\"" }; hookProc = Runtime.getRuntime().exec(cmd); } } catch (IOException ioe) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_HOOK_FAILURE, "Failed to start ''{0}'' hook: {1}", new Object[] { hookFile, ioe.getLocalizedMessage() }); SVNErrorManager.error(err, ioe); } runHook(hookFile, hookName, hookProc, null, readErrorStream); }
SVNErrorManager.error(err, ioe); runHook(hookFile, hookName, hookProc, paths, path != null);
private static void runChangeRevPropHook(File reposRootDir, String hookName, String propName, byte[] propValue, String author, long revision, String action, boolean isPre) throws SVNException { File hookFile = getHookFile(reposRootDir, hookName); if (hookFile == null) { if (isPre) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_DISABLED_FEATURE, "Repository has not been enabled to accept revision propchanges;\nask the administrator to create a pre-revprop-change hook"); SVNErrorManager.error(err, SVNLogType.FSFS); } return; } author = author == null ? "" : author; runHook(reposRootDir, hookName, new String[] {String.valueOf(revision), author, propName, action}, propValue); }
private static void runChangeRevPropHook(File reposRootDir, String hookName, String propName, byte[] propValue, String author, long revision, String action, boolean isPre) throws SVNException { File hookFile = getHookFile(reposRootDir, hookName); if (hookFile == null) { if (isPre) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_DISABLED_FEATURE, "Repository has not been enabled to accept revision propchanges;\nask the administrator to create a pre-revprop-change hook"); SVNErrorManager.error(err, SVNLogType.FSFS); } return; } author = author == null ? "" : author; runHook(reposRootDir, hookName, new String[] {String.valueOf(revision), author, propName, action}, propValue); }
SVNErrorManager.error(err, ioe); runHook(hookFile, hookName, hookProc, propValue, isPre);