Subversion Repositories DevTools

Rev

Rev 1291 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1291 Rev 4226
Line -... Line 1...
-
 
1
REM Maintained in package SubversionServerSupport
1
REM !/bin/sh
2
REM
-
 
3
REM Prevent changes to the /tags/ directory
-
 
4
REM MOST Users are allowed to create a tag, but not to delete or rename them
-
 
5
REM unless the tag ends in the key-text .WIP.
2
 
6
REM
-
 
7
REM Args %1 - Repo Path
-
 
8
REM      %2 - Transaction ID
3
set REPOS=%1
9
set REPOS=%1
4
set TXN=%2
10
set TXN=%2
5
 
11
 
6
set SVNLOOK="C:\Program Files (x86)\VisualSVN Server\bin\svnlook.exe"
12
set SVNLOOK="C:\Program Files (x86)\VisualSVN Server\bin\svnlook.exe"
7
 
13
 
Line 23... Line 29...
23
REM Not a WIP
29
REM Not a WIP
24
REM Only allowed to add
30
REM Only allowed to add
25
%SVNLOOK% changed -t %TXN% %REPOS% | findstr /B /V A >/nul
31
%SVNLOOK% changed -t %TXN% %REPOS% | findstr /B /V A >/nul
26
if not %errorlevel%==0 (goto AllowCommit)
32
if not %errorlevel%==0 (goto AllowCommit)
27
 
33
 
-
 
34
:NotAllowed
28
REM Who is doing this
35
REM Who is doing this
29
for /f %%i in ('%SVNLOOK% author -t %TXN% %REPOS%') do set AUTHOR=%%i
36
for /f %%i in ('%SVNLOOK% author -t %TXN% %REPOS%') do set AUTHOR=%%i
30
if %AUTHOR%==buildadm goto AllowCommit
37
if %AUTHOR%==buildadm goto AllowCommit
31
rem if %AUTHOR%==dpurdie goto AllowCommit
38
if %AUTHOR%==dpurdie goto AllowCommit
32
 
39
 
33
:NotAllowed
-
 
34
echo>&2 User %AUTHOR% is not allowed to modify tags once they are created.
40
echo>&2 User %AUTHOR% is not allowed to modify tags once they are created.
35
%SVNLOOK%>&2 changed -t %TXN% %REPOS%
41
%SVNLOOK%>&2 changed -t %TXN% %REPOS%
36
exit 1
42
exit 1
37
 
43
 
38
:AllowCommit
44
:AllowCommit