First register the file with subversion for keyword substitution. For example, you may need to add the actual revision number to the source code.
$ svn propset svn:keywords "Revision" source_file.c property 'svn:keywords' set on 'source_file.c' $
Next, edit your source code and add the keywords that you wish to be replaced, e.g.
#define VERSION "V 1.0 $Rev$"
Finally, from now on each time you commit the file to subversion, e.g., after you commit the file:
$ svn commit source_file.c -m "file with rev. id" Sending source_file.c Transmitting file data . Committed revision 190. $
Now if you view your source code, it will have the revision number in the code, e.g.
#define VERSION "V 1.0 $Rev 190 $"
and each time you edit and commit the changes the revision number will be updated.
Advertisement
July 8, 2011 at 2:33 pm |
this will add the file version number…i want to add the top folder version number .. can u tell how to do that