public static FSTransactionInfo beginTransactionForCommit(long baseRevision, SVNProperties revisionProperties, FSFS owner) throws SVNException { List caps = new ArrayList(); caps.add("mergeinfo"); String author = revisionProperties.getStringValue(SVNRevisionProperty.AUTHOR); if (owner != null && owner.isHooksEnabled()) { FSHooks.runStartCommitHook(owner.getRepositoryRoot(), author, caps); } FSTransactionInfo txn = FSTransactionRoot.beginTransaction(baseRevision, FSTransactionRoot.SVN_FS_TXN_CHECK_LOCKS, owner); owner.changeTransactionProperties(txn.getTxnId(), revisionProperties); return txn; }
public void unlockPath(String path, String token, String username, boolean breakLock, boolean enableHooks) throws SVNException { path = SVNPathUtil.canonicalizeAbsolutePath(path); String[] paths = {path}; if (!breakLock && username == null) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.FS_NO_USER, "Cannot unlock path ''{0}'', no authenticated username available", path); SVNErrorManager.error(err, SVNLogType.FSFS); } if (enableHooks && isHooksEnabled()) { FSHooks.runPreUnlockHook(myRepositoryRoot, path, username); } FSWriteLock writeLock = FSWriteLock.getWriteLockForDB(this); synchronized (writeLock) { try { writeLock.lock(); unlock(path, token, username, breakLock); } finally { writeLock.unlock(); FSWriteLock.release(writeLock); } } if (enableHooks && isHooksEnabled()) { try { FSHooks.runPostUnlockHook(myRepositoryRoot, paths, username); } catch (SVNException svne) { SVNErrorMessage err = SVNErrorMessage.create(SVNErrorCode.REPOS_POST_UNLOCK_HOOK_FAILED, "Unlock succeeded, but post-unlock hook failed"); err.setChildErrorMessage(svne.getErrorMessage()); SVNErrorManager.error(err, svne, SVNLogType.FSFS); } } }
if (isHooksEnabled()) { customToken = FSHooks.runPreLockHook(myRepositoryRoot, path, username, comment, stealLock); if (customToken != null) { if (isHooksEnabled()) { try { FSHooks.runPostLockHook(myRepositoryRoot, paths, username);
public long commitTxn(boolean runPreCommitHook, boolean runPostCommitHook, SVNErrorMessage[] postCommitHookError, StringBuffer conflictPath) throws SVNException { if (myFSFS.isHooksEnabled() && runPreCommitHook) { FSHooks.runPreCommitHook(myFSFS.getRepositoryRoot(), myTxn.getTxnId()); if (myFSFS.isHooksEnabled() && runPostCommitHook) { try { FSHooks.runPostCommitHook(myFSFS.getRepositoryRoot(), newRevision);