SVN 小记2

http://www.oschina.net/question/130710_32473 实在想不到办法限制上传文件大小, 就改成限制文件类型了,以下这 pre-commit.bat 内容:   01@echooff02 03setsvnlook="D:\Subversion\bin\svnlook.exe"04setrepos=%105settxn=%206 07%svnlook% changed -t %txn% %repos%|findstr /I "mts$"08if%errorlevel% EQU 0 (goto err1)09%svnlook% changed -t %txn% %repos%|findstr /I "avi$"10if%errorlevel% EQU 0 (goto err1)11%svnlook% changed -t %txn% %repos%|findstr /I "mov$"12if%errorlevel% EQU 0 (goto err1)13%svnlook% changed -t %txn% %repos%|findstr /I "mpg$"14if%errorlevel% EQU 0 (goto err1)15%svnlook% changed -t %txn% %repos%|findstr /I "mpeg$"16if%errorlevel% EQU 0 (goto err1)17%svnlook% changed -t %txn% %repos%|findstr /I "tif$"18if%errorlevel% EQU 0 (goto err1)19%svnlook% changed -t %txn% %repos%|findstr /I "exe$"20if%errorlevel% EQU 0 (goto err1)21%svnlook% changed -t %txn% %repos%|findstr /I "ai$"22if%errorlevel% EQU 0 (goto err1)23%svnlook% changed -t %txn% %repos%|findstr /I "flv$"24if%errorlevel% EQU 0 (goto err1)25%svnlook% changed -t %txn% %repos%|findstr /I "eps$"26if%errorlevel% EQU 0 (goto err1)27 28%svnlook% changed -t %txn% %repos%|findstr /I "thumbs.db$"29if%errorlevel% EQU 0 (goto err2)30%svnlook% changed -t %txn% %repos%|findstr /I "~"31if%errorlevel% EQU 0 (goto err2)32%svnlook% changed -t %txn% %repos%|findstr /I "\/\."33if%errorlevel% EQU 0 (goto err2)34 35:ok36exit037 38:err139echo. >&240echo错误:禁止提交类型为 MTS,AVI,mov,MPEG,flv,tif,ai,eps,exe,db 类型的文件 ... >&241exit142 43:err244echo. >&245echo错误:禁止提交 thumbs.db 文件,或者文件名含 ~ 的文件 ... >&246exit1
posted @ 2012-07-16 18:43  adodo1  Views(106)  Comments(0Edit  收藏  举报