Guest User

Untitled

a guest
Aug 15th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. Users validation in SVN pre-commit hook
  2. @echo off
  3. REM user1, user2, user3 are example
  4. set VALID_USERS=user1,user2,user3
  5.  
  6. set SVNROOT="C:Program FilesCollabNet Subversion Serversvnlook.exe"
  7. set REPOS=%1%
  8. set TXN=%2%
  9.  
  10. %SVNROOT% author %REPOS% -t %TXN% | findstr /r "^%VALID_USERS%$" >nul
  11. if %errorlevel% EQU 0 (
  12. echo This is an invalid user 1>&2
  13. exit 1
  14. ) else (
  15. echo This is valid user 1>&2
  16. exit 0
  17. )
  18.  
  19. [/tags]
  20. * = r
  21. @R_SVN_ADMINS = rw
  22.  
  23. [/tags/r1.0]
  24. @R_SVN_ADMINS = r
  25.  
  26. REM Block deletion of folder/file in trunk
  27. %SVNLOOK% changed %REPOS% -t %TXN% | findstr /r "^D.*trunk/.*$" >nul
  28. if %errorlevel%==0 (goto DeleteInTrunkError)
  29.  
  30. REM DeleteInTrunkError
  31. REM ------------------------
  32. :DeleteTrunkTagsError
  33. echo. 1>&2
  34. echo Trunk Delete Error: 1>&2
  35. echo Only Administrator can delete in the trunk folder. 1>&2
  36. echo Commit details: 1>&2
  37. %SVNROOT% changed %REPOS% -t %TXN% 1>&2
  38. exit 1
Add Comment
Please, Sign In to add comment