Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use global revision number keyword with TortoiseSVN?

In CVS you can use keywords in your code that are expanded when checking the files out. I'd like to display the global revision as CVS has with the $GlobalRev$ keyword.

Subversion has the $Rev$ command but it only shows the latest revision that the file was changed. I know there is a svnversion command that has as of right now no documentation what so ever in 1.5 and 1.6 nightly.

I'm interested to know how to do this with TortoiseSVN.

like image 278
Spoike Avatar asked May 07 '09 09:05

Spoike


People also ask

How do I find my svn revision number?

"svn info --show-item revision" will give the current revision to which the current directory is updated.

How do I checkout with TortoiseSVN?

Right click on the checked out folder, then use TortoiseSVN → Update to Revision and select Choose items.... This opens the same dialog that was available in the original checkout and allows you to select or deselect items to include in the checkout.


2 Answers

svnversion is still available, and is documented in 1.5

svnversion is a program for summarizing the revision mixture of a working copy. The resultant revision number, or revision range, is written to standard output.

Use this to get the revision of your working copy after you've checked it out, the documentation for KeywordExpansion describes how its designed to be used.

like image 80
gbjbaanb Avatar answered Oct 11 '22 08:10

gbjbaanb


I don't think there's an option to have the same thing as in CVS, at least I couldn't find any when I needed that.

Instead I use TortoiseSVN's SubWCRev.exe to turn a template file containing a $WCREV$ string into one with the current revision number.

like image 41
macbirdie Avatar answered Oct 11 '22 08:10

macbirdie