Rev 4226 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
REM !/bin/shset REPOS=%1set TXN=%2set SVNLOOK="C:\Program Files (x86)\VisualSVN Server\bin\svnlook.exe"REM does not contains /tags/ - allowed to commit%SVNLOOK% changed -t %TXN% %REPOS% | findstr /r \/tags\/ >/nulif not %errorlevel%==0 (goto AllowCommit)REM contains /tags/REM Only allow operations on directoriesREM If not a directory then fail%SVNLOOK% changed -t %TXN% %REPOS% | findstr /r \/tags\/ | findstr /r /c:".*\/\>" >/nulif not %errorlevel%==0 (goto NotAllowed)REM Have a directory only operationREM End in .WIP/ then its allowed to ADD and DELETE%SVNLOOK% changed -t %TXN% %REPOS% | findstr /r \/tags\/ | findstr /r /c:"\.WIP/\>" >/nulif %errorlevel%==0 (goto AllowCommit)REM Not a WIPREM Only allowed to add%SVNLOOK% changed -t %TXN% %REPOS% | findstr /B /V A >/nulif not %errorlevel%==0 (goto AllowCommit)REM Who is doing thisfor /f %%i in ('%SVNLOOK% author -t %TXN% %REPOS%') do set AUTHOR=%%iif %AUTHOR%==buildadm goto AllowCommitrem if %AUTHOR%==dpurdie goto AllowCommit:NotAllowedecho>&2 User %AUTHOR% is not allowed to modify tags once they are created.%SVNLOOK%>&2 changed -t %TXN% %REPOS%exit 1:AllowCommitREM All checks passed, so allow the commit.exit 0