0

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.

Some programmer dude
  • 380,411
  • 33
  • 383
  • 585
Peter
  • 1,539
  • 2
  • 23
  • 42

1 Answers1

2

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 $".

Constantinius
  • 32,691
  • 7
  • 72
  • 83
  • That's nearly exact what I searched for. But SVN_REV is then something like that `"$Id: xxx.c 78 2012-09-04 08:42:34Z Author $"` It would be nice just to have the Revision no. That would be no problem with c++ (substr) but so far as I know is no function like that available in C. – Peter Sep 04 '12 at 08:57
  • Then you have to use `$Revision$` instead of `$Id$`. I'll update my answer. – Constantinius Sep 04 '12 at 09:40