Rev 4226 | Blame | Compare with Previous | Last modification | View Log | RSS feed
REM Maintained in package SubversionServerSupportREMREM Prevent changes to the /tags/ directoryREM MOST Users are allowed to create a tag, but not to delete or rename themREM unless the tag ends in the key-text .WIP.REMREM Args %1 - Repo PathREM %2 - Transaction IDset REPOS=%1set TXN=%2set SVNLOOK="%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):NotAllowedREM Who is doing thisfor /f %%i in ('%SVNLOOK% author -t %TXN% %REPOS%') do set AUTHOR=%%iif %AUTHOR%==buildadm goto AllowCommitif %AUTHOR%==dpurdie goto AllowCommitecho>&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