Add svn comment (revision history) to (script) file
Is it possible with Subversion to add the Revision History to a file开发者_如何学JAVA with a svn property as with Id, Rev, Author? We would like to have the revision history automatically added to the beginning of a file.
Why? You already have all the information in SVN.
This will simply clutter your code files - do you really want people to scroll down several pages of this before starting to see code?
My advice it to leave your code files alone and if you need revision history, use your revision control tool (SVN) to get it.
Since this is a must, look at this blog post.
It sound like you want to do something similar as the evil $log$ keyword in CVS. There's a reason why it was called evil, and why it was left out of Subversion with no plans to implement it.
I would highly recommend that you do this in your build system (Yes, I know these are shell scripts, and shell scripts aren't compiled, but a build system can be used for packaging). PUt this information into a release notes file, and not in your shell scripts.
If you really, really insist this must be done, you can use Ant to munge your shell scripts during packaging. You can put the dreaded $LOG$
keyword in your shell scripts, and when Ant does the packaging, it can replace $LOG$
with the Subversion history.
精彩评论