<p>I'd like to implement a way of recording the version of a project within code, so that it can be used when testing and to help track bugs. 
It seems the best version number to use would just be the current revision number from Subversion. Is there an easy way to hook this number into a (C++ in my case) header file or something, which I can then get at in code? I guess this is a post commit hook or something?</p>

<p>Does anyone have any experience of implementing this (with code to share, please?), or can suggest a better alternative?
Thanks.</p>

You can use the
```
svn:keywords
```
property to enable the
```
Rev
```
keyword.
You can then use
```
$Rev$
```
in your code and SVN will expand it automatically when updating to
```
$Rev: 256 $
```
which can then parse...
More info on the Subversion manual