zoukankan      html  css  js  c++  java
  • [z]windows下Svn服务器之必须提交修改注释篇

    1. 强制添加注释信息
    找到Respositories目录下对应项目里的hooks目录下建立pre-commit.bat文件,复制如下内容:

    @echo off
    set SVNLOOK="C:\Program Files\VisualSVN\bin\svnlook.exe"
    setlocal
    set REPOS=%1
    set TXN=%2
    rem check that logmessage contains at least 10 characters
    %SVNLOOK% log "%REPOS%" -t "%TXN%" | findstr ".........." > nul
    if %errorlevel% gtr 0 goto err
    exit 0
    :err
    echo Empty log message not allowed. Commit aborted! 1>&2
    exit 1
    2. 允许用户修改注释信息

    找到Respositories目录下对应项目里的hooks目录下建立pre-revpos-change.bat,复制如下内容:

    @ECHO OFF
    set repos=%1
    set rev=%2
    set user=%3
    set propname=%4
    set action=%5
     
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: Only allow changes to svn:log. The author, date and other revision
    :: properties cannot be changed
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    if /I not '%propname%'=='svn:log' goto ERROR_PROPNAME
     
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: Only allow modifications to svn:log (no addition/overwrite or deletion)
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    if /I not '%action%'=='M' goto ERROR_ACTION
     
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: Make sure that the new svn:log message contains some text.
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    set bIsEmpty=true
    for /f "tokens=*" %%g in ('find /V ""') do (
     set bIsEmpty=false
    )
    if '%bIsEmpty%'=='true' goto ERROR_EMPTY
     
    goto :eof
     
     
     
    :ERROR_EMPTY
    echo Empty svn:log properties are not allowed. >&2
    goto ERROR_EXIT
     
    :ERROR_PROPNAME
    echo Only changes to svn:log revision properties are allowed. >&2
    goto ERROR_EXIT
     
    :ERROR_ACTION
    echo Only modifications to svn:log revision properties are allowed. >&2
    goto ERROR_EXIT
     
    :ERROR_EXIT
    exit /b 1
     

     




  • 相关阅读:
    eclipse真机调试显示Target unknown的解决方法
    教你看懂GERBER中的钻孔(.txt)文件
    Quartus ii 12.0 和ModelSim 10.1 SE安装及连接
    Android的学习——ubuntu下android5.1源码的make编译
    ubuntu 14.04 下找不到命令,路径出错
    【转载】VMware虚拟机修改硬盘容量大小
    Fedora10下建立linux系统的窗口没有地址栏
    [转]SecureCRT连接主机时,无法从键盘输入
    在FASTBuild中使用Distribution
    在FASTBuild中使用Caching
  • 原文地址:https://www.cnblogs.com/freemobile/p/1937515.html
Copyright © 2011-2022 走看看