SVN Source code revision numbers

Dec 22, 2009 at 7:02 PM

Is there any possibility of adding support to use SVN revision numbers as a version style?  I think the best way to do this would be to pull the revision from the current directory of the project file.

For me, I think the ideal version number would be:


or some variation similar to that.


A discussion thread below mine mentions SVN, but it sounds like a bit of a hack the way it is described.


Thanks for this great tool!

Dec 23, 2009 at 11:03 AM


Yes, I think an option to pull the SVN version from its files would be good. You could probably acheive this via reading the "entries" file inside the root .svn folder.

So Inside "<MyProject>/.svn/entries" is the following for example: (I think its on newlines as wordpad displays it, I've removed duplicate new lines for readability

Bolded and underlined the SVN revision number to use.


Dec 31, 2009 at 4:18 PM

If someone isn't already working on this, and if the project people are wanting to add this SVN revision feature, I'd be willing to take a look into adding it.

Jan 4, 2010 at 7:13 PM

I'd be happy to help!

Jan 5, 2010 at 4:21 PM

I've been looking into various ways to do this.


The first way would to get the revision number is the way philjones suggests above.  It may also be better to grab the next number on the list, which I believe is the latest committed revision.  This would helpful for tags and branches.  If you're building a tagged branch, you probably are more interested in the latest revision of that tag, rather than latest revision of the repository, which will likely be completely different.


The second and third option are both using command line tools: "svn.exe info" and "svnversion.exe"  These are both part of the subversion package, and could probably be bundled without too much fuss.  Of course, it would still mean relying on an external tool which isn't very desirable.


Another option is to use SVNSharp, however I believe its just a .Net wrapper around the command line tools.  If that's the case (I need to do a little more research), it would probably be overkill to bring in.


So this first option seems the most attractive as it would be the most lightweight.  However, I'd like to find out for sure if this "entries" file format is dependable and consistent for everyone.  I imagine the SVN folks would prefer we use their tools or API, but I don't know that for sure.

Jan 18, 2010 at 2:57 PM

Hey, any news on the patch I emailed?

Jan 18, 2010 at 10:08 PM

Awesome, thanks!  Let me know if you have any questions.

Jan 19, 2010 at 2:54 PM

I just checked out the licensing situation, and the GPL website indicates that Apache v2.0 is compatible, which is what the SharpSvn libraries are using, so you should be good there.

There's a number of licenses included with SharpSVN, but since the only library that needs to be distributed is the SharpSVN.dll, I don't think you'll have to worry about the rest.


Jan 22, 2010 at 1:58 PM

This is really good stuff - thank you and grimus for providing this helpful feature!

Is there a download available with this patch? Or better: when do you think comes this feature into the stable or into the beta version?


Feb 10, 2010 at 8:03 PM

Hey, is there any news on this?

Would it be helpful if I resubmitted the patch on the Source Code page?

Feb 12, 2010 at 3:49 PM

Alright, sounds pretty cool.  I feel honored to be a feature starter :)  I'll keep an eye out for when you guys have more details on the plug in system.

May 15, 2010 at 10:47 PM

Hey, any news on this? Version 2.2 is out but no VSN support.

May 16, 2010 at 11:39 PM

Grimus created a plugin that does the trick.

Apr 27, 2011 at 7:50 AM
Edited Sep 15, 2011 at 9:23 AM

I also created a plugin using Sharpsvn before I found this post - extra work for me ;-(