Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
669 views
in Technique[技术] by (71.8m points)

svn - Subversion as version-incrementor at each commit?

I'd like to update the (highest) revision number to a file inside a subversion repository after each commit.

I thought of a svn version keyword, but doesn't this only get updated if the specific file was changed?

i.e. I have a file version.php where i have the version/revision numbers, but only update anotherfile.php in my commit - this won't change the version/revision information version.php has.

Is a commit hook my only option? If yes, any examples?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Sounds like you want some kind of $GlobalRev$ to get the global revision number into your files.

The appropriate tool you may want to look at would be svnversion

You can use it as post-commit hook or in your build/deployment process to create or modify a global version file.

Also see "Where's $GlobalRev$?" in this page


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...