SVN hooks for Windows

后端 未结 9 952
温柔的废话
温柔的废话 2021-01-30 00:18

I did a little googling and found that there isn\'t really a resource of SVN hooks for Windows. So I figured I\'d start a wiki here to centralize it.

If you contribute,

9条回答
  •  爱一瞬间的悲伤
    2021-01-30 00:56

    This hook prevents commits to a specific branch

    (branch-16E in this case):

    setlocal
    
    rem Subversion sends through the path to the repository and transaction id  
    set REPOS=%1
    set TXN=%2
    
    rem Committing to a branch is not allowed
    svnlook changed -t %TXN% %REPOS% | findstr "\/branch-16E"
    if %errorlevel% EQU 0 goto errb else exit 0
    
    :errb
    echo. 1>&2
    echo This branch was closed. If you want to commit here contact your administrator. 1>&2
    exit 1
    

提交回复
热议问题