开发者

How to change svn commit message

I wrote a script which can auto commit in every 10 minutes. But it's commit message always same ("Code saved"). But i want to change some of them which are milestone.

This is my auto commit script:

cd c:\inetpub\wwwroot\siteCodes
svn commit -m "Code Sav开发者_如何学Ced"

How can i write a script which can give me a chance to write revision number and new commit message.


This is a bad approach, you should not auto-commit. Source control should not be treated like a backup system.

Instead, commit when a logical chunk of work is completed. Always try to commit code in a state that will build properly. And then, you have the opportunity to type whatever commit message you want.


To answer your actual question (at personal risk), svn requires explicit permission to be set in a hook script before it will allow the log message to be changed. I never have a repository long before I need this. Here's a batch file you can use. Put it in the repository's "hooks" folder and call it pre-revprop-change.bat

http://svn.haxx.se/users/archive-2006-03/0107.shtml

Or a little more readable version,

http://ayria.livejournal.com/33438.html

Of course, I agree with everyone else that your setup is very sub-optimal. But you'll inevitably need to change the log message for a good reason sooner or later. :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜