[sword-devel] CVS question

Bobby Nations sword-devel@crosswire.org
Mon, 01 Apr 2002 21:24:05 -0600


Yep, you've assumed correctly, that's a CVS keyword.  All you need to 
put in your code is the "$Id$" and CVS will expand out the rest, or you 
can copy and paste one from anywhere into your code.  CVS will replace 
the relevant portions the next time that you check you code into the 
repository..  If you're curious, the text that gets put there is the 
file name, it's revision number, the date/time of the last change to the 
file, the culprit's (:-) login name and the tag associated with the 
file.  There's lots of info available on CVS at 
http://www.cvshome.org/docs.  The book written by Karl Fogel is just 
about the best around to get you up and running on it.

Many folks assign the keyword to a string variable that can be parsed 
later on for useful information like so.

// Beware ... Java code follows :-)
public class VersionedClass {
    public String version="$Id$";

This is particularly useful if you're debugging a product that has gone 
out the door (i.e. your exchanging emails with poor hapless user) and 
you need to verify which version of a particular class is in the binary. 
 If you've built in a mechanism for printing out the 'version' variable, 
then , voila the mystery will be solved.  I use this at work for 
distributed components such as CORBA, EJB's, servlets and cgi programs 
when I need to debug an installed application that might have been there 
for some time.  

BTW, I'm jealous of you being able to work in Mac OS X.  Can't wait 
until I get the money scraped together to get am iMac for myself.  What 
a sweet, sweet little machine, and decently priced for an Apple product.



Nathan wrote:

> I noticed that files contain something like this:
>  $Id: versekey.h,v 1.24 2002/03/22 05:26:34 scribe Exp $
> I assume CVS updates this text, so should I put something in my files 
> so this will happen if/when they get put into CVS.
>  $Id: Exp $
> ?
> - n8