csvn

Subclipse: add revision no in file


Is there a possibility to insert the revision no of a file in the file.

For example in the description or in a string. Maybe there is a kind of preprocessor command.


Solution

  • I prefer this way:

    in your C file:

    #define SVN_FULL_REV "$Id$"
    #define SVN_REV "$Revision$"
    

    Then do:

    svn propset svn:keywords 'Id Revision' yourfile.c
    

    Everytime you commit or update the file, SVN_REV will be your revision ID and SVN_FULL_REV the entire info string like "$Id: xxx.c 78 2012-09-04 08:42:34Z Author $".