Label Cloud

Wednesday, December 05, 2007

Subversion pre-revprop-change hook

Another small batch file hook for those running subversion on windows. This hook will allow users to update a log message on the old check-in.

Note: Property changes are not versioned, so you will permanently loose the old message.

Place this in a pre-revprop-change.cmd
-------------
IF %5 EQU M GOTO CONT1
GOTO FAIL
:CONT1
IF %4 EQU svn:log GOTO OK
:FAIL
echo "Changing revision properties other than svn:log is prohibited" >&2
exit 1
:OK
exit 0
------------

 

Technorati Tags: , ,


Share/Save/Bookmark

6 comments:

Anonymous said...

Thank you for posting this!!!

Hard to find windows solution when you are in a hurry :)

Tim A said...

This came in real handy. Thanks for posting.

Anonymous said...

Thanks for posting this.

Coach P said...

Thanks soooooo much! Although one comment sticks to multiple files committed in one version, this was great to allow me to generalize the comment. (I'm a stickler on checkin comments)

Thanks for preserving my sanity! :)

asmcad said...

------------
rem Only allow log messages to be changed.
if "%4" == "svn:log" exit 0
echo Property '%4' cannot be changed >&2
exit 1
------------
this one works too.
make this .bat file and put your repository.

if you need to change "user" just make
"svn:log" to "svn:author"

fajr said...

Thanks! really!