1. Force Add comment information
Find the hooks directory in the corresponding project under the respositories directory to create a pre-commit.bat file, copy the following content:
@ Echo offset svnlook = "C: \ Program Files \ visualsvn \ bin \ svnlook.exe "setlocalset repos = % 1 Set txn = % 2rem check that logmessage contains at least 10 characters % svnlook % log" % repos % "-t" % txn % "| findstr ".......... "> nulif % errorlevel % gtr 0 goto errexit 0: errecho empty log message not allowed. commit aborted! 1> & 2 exit 1
2. allow users to modify comments
Find the hooks directory in the corresponding project under the respositories directory to create a pre-revpos-change.bat, copy the following content:
@ 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