Pete Klammer wrote:
Todd wrote (as I have seen many others recommend many times):
Ignore the cvs _revision_ information, it is for CVS's use only. By changing
the cvs revision information you may run the risk of breaking assumptions
the cvs code has about things being on the 1.x revision set and no those
assumptions are not documented any where. Use tags (symbolic names )for
the humans, i.e. if you want the set of files in a sand box versioned for
cvs tag VERSION_2_1
Are tags embeddable in source via $keywords ?
I have code like this:
char strRevision = "$Revision: 13.80 $" ;
char strLocker = "$Locker: $" ;
char strCompilationDate = __DATE__ ;
char strCompilationTime = __TIME__ ;
... and this ...
... So my code is version-aware at execution time, can communicate and
compare its major or minor version with other programs, etc.
Can you do that with tags?
Unfortunately I do not know of any RCS keywords that put the tag in the
checked out file. There might be something lurking about in the new cvs
1.12.x version, that I am unaware of though.
however, I have done pretty much what you want by other means in the past.
My baselines are tagged using a script, which happens to write either one or
two files, the first file is a listing of all the tags and the reasons the
tags were placed, the second file (when it is written) is a header file
generally named version_number.h with the format:
/* THIS FILE IS AUTOMATICALLY GENERATED!!! DO NOT MODIFY!!!
char VersionNumber="MY_PROG version: 3.4 MY_TAG_3_4 controlled date - 22
and that file is included by any program that needs it.
Because the script writes (and commits) these just before applying the tag, I
get the added benefit of having a record, within a second or two, of when tags
Crane Division, Naval Surface Warfare Center (NSWC Crane)
Harnessing the Power of Technology for the Warfighter