Reputation:

pre-revprop-change hook in TortoiseSVN

Total newbie to TortoiseSVN here. I need to change a log message for some commits I made to subversion. I only want to make my changes and then have everything go back to the way it was before, meaning you can't change anything after the commit.

According to this post (What is a pre-revprop-change hook in SVN, and how do I create it?), I understand you have to create a pre-revprop-change.bat file to do this.

My question is if I just add this bat file, make the changes to the log messages, and then remove the bat file, will the settings go back to the previous state (ex. log messages uneditable).. or do I have run the bat file myself and then come up with another script to undo the changes?

Thanks!

Upvotes: 4

Views: 12633

Answers (3)

MageWind
MageWind

Reputation: 841

Use the accepted answer from this question to get the pre-revprop-change hook code. Make the file and put it in the repository's hooks directory. Now you can change the log messages. If you don't want to be able to change the log messages anymore, delete pre-revprop-change.bat.

Upvotes: 0

Jan Hettich
Jan Hettich

Reputation: 9886

Another option is to use svnadmin to change the log message:

echo "My new commit message." > newmsg.txt
svnadmin setlog path/to/repository -r nnn newmsg.txt --bypass-hooks

where nnn is the revision number.

Upvotes: 2

Daniel Vandersluis
Daniel Vandersluis

Reputation: 94284

Sorry, I misunderstood your question in my original answer.

In order to use the svn propedit command on a revision properly (like svn:log which is the log message property), you do need a pre-revprop-change hook, because the default behaviour is to deny revision property changes. The easiest way to add a pre-revprop-change hook is to make a copy of the pre-revprop-change.tmpl file (which you'll find in /repository-name/hooks in your svn directory), call it pre-revprop-change and make it executable (chmod a+x).

After you run your propedit commands, you can either remove the hook to revert to default behaviour, or change it to always exit with a non-zero return code.

Upvotes: 4

Related Questions