SVN修改日志限制脚本

prettyice 2011-12-16

@echooff

setSVN_BINDIR=C:\"ProgramFiles"\"VisualSVNServer"\bin

setlocalenableextensionsenabledelayedexpansion

setrepos="%1"

setrev="%2"

setuser="%3"

setpropname="%4"

setaction="%5"

setsuperUser=admin

sets=%SVN_BINDIR%\svnlookauthor"%repos%"-r"%rev%"

remusebackq中的集合对于路径用双引号,字符串用单引号,命令用后引号,这里用的就是后引号。

for/f"usebackq"%%kin(`%s%`)do@setvar=%%k

setrightUser=0

if"%3"=="%superUser%"setrightUser=1

if"%3"=="%var%"setrightUser=1

if%rightUser%==0gotoERROR_USER

goto:SUCCESS_EXIT

:ERROR_USER

echoyoucanonlymodifyyourownlog.>&2

exit1

:SUCCESS_EXIT

IF%propname%=="svn:log"exit0

ECHO"Changingrevisionproperties%propname%isprohibited">&2

EXIT1

相关推荐

leehbhs / 0评论 2020-03-04