Doing it in Windows always have extra steps. Save a copy of this pre-revprop-change template file locate under the /hooks directory into .bat extension, replace the code with the one I got from this article. What a nice and clean code.
@ECHO OFF :: Set all parameters. Even though most are not used, in case you want to add :: changes that allow, for example, editing of the author or addition of log messages. set repository=%1 set revision=%2 set userName=%3 set propertyName=%4 set action=%5 :: Only allow the log message to be changed, but not author, etc. if /I not "%propertyName%" == "svn:log" goto ERROR_PROPNAME :: Only allow modification of a log message, not addition or deletion. if /I not "%action%" == "M" goto ERROR_ACTION :: Make sure that the new svn:log message is not empty. 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 messages are not allowed. >&2 goto ERROR_EXIT :ERROR_PROPNAME echo Only changes to svn:log messages 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
Done with first step, now come to second step, is to edit the commit message or adding a commit message. If the commit message is already there, use this command to remote access the SVN server to modify the commit message.
svn propedit --revprop -r 25 svn:log \ http://128.230.9.166/svn/trunk/TheJava.java "Update a commit message." \ --editor-cmd notepad.exeThis is to tell SVN that I'm going to update the commit message on revision 25 where the particular file is located at http://128.230.9.166/svn/trunk/ directory using notepad as editor.
If --editor-cmd is not provided, this will assume that the SVN_EDITOR environment variable has been set, otherwise an error will be prompt "None of the environment variables SVN_EDITOR, VISUAL or EDITOR are set...".
If the commit message isn't there, then use this command to add a new commit message.
svn propset -r 25 --revprop svn:log \ "new log message" http://128.230.9.166/svn/trunk/TheJava.javaThis is to tell SVN that I'm going to add a new commit message on revision 25 where the particular file is located at http://128.230.9.166/svn/trunk/ directory
No comments:
Post a Comment