[darcs-users] Re: More on version management...

Keith Wansbrough Keith.Wansbrough at cl.cam.ac.uk
Mon Mar 22 15:14:55 UTC 2004


> I'm told $Id$ expands to something like:
> 
> $Id: Foo.hs,v 1.2 2003/03/04 03:22:34 myuser Exp $
> 
> OTTOMH I think the tuple
>   (tagname (~= version), date of tag creation, e-mail address of tag creator)
> is unique and, along with the filename, is essentially the same
> information.

Full list below.  The exact expansions are not critical (to me anyway), 
but the ability to do this kind of thing is.

> To get around the modification of source files problem in Shae's URL
> perhaps "darcs flatten foo" or somesuch could be used to explicitly say
> "I'm taking foo away to print now so please expand $Id$ in it". It could
> complain if the current repo state isn't tagged (or prompt you for a
> name to tag it with) or if foo has unrecorded changes.

CVS (really RCS underneath, I think) actually stores just $Id$ etc in 
the file; expansion is done (if requested) on checkout, and stripping 
on commit.  There are various flags to control exactly when these 
things are done wrt merging, diffs, etc; for example, "-kk" switches it 
off entirely, so you always get the shortform $Id$ rather than the long 
version.

The full set of flags from my local CVS is as follows (info cvs is your 
friend):

`$Author$'
     The login name of the user who checked in the revision.

`$Date$'
     The date and time (UTC) the revision was checked in.

`$Header$'
     A standard header containing the full pathname of the RCS file,
     the revision number, the date (UTC), the author, the state, and
     the locker (if locked).  Files will normally never be locked when
     you use CVS.

`$Id$'
     Same as `$Header$', except that the RCS filename is without a path.

`$Name$'
     Tag name used to check out this file.  The keyword is expanded
     only if one checks out with an explicit tag name.  For example,
     when running the command `cvs co -r first', the keyword expands to
     `Name: first'.

`$Locker$'
     The login name of the user who locked the revision (empty if not
     locked, which is the normal case unless `cvs admin -l' is in use).

`$Log$'
     The log message supplied during commit, preceded by a header
     containing the RCS filename, the revision number, the author, and
     the date (UTC).  Existing log messages are _not_ replaced.
     Instead, the new log message is inserted after `$Log:...$'.  Each
     new line is prefixed with the same string which precedes the
     `$Log' keyword.  For example, if the file contains:

            /* Here is what people have been up to:
             *
             * $Log: frob.c,v $
             * Revision 1.1  1997/01/03 14:23:51  joe
             * Add the superfrobnicate option
             *
             */

     then additional lines which are added when expanding the `$Log'
     keyword will be preceded by `   * '.  Unlike previous versions of
     CVS and RCS, the "comment leader" from the RCS file is not used.
     The `$Log' keyword is useful for accumulating a complete change
     log in a source file, but for several reasons it can be
     problematic.  *Note Log keyword::.

`$RCSfile$'
     The name of the RCS file without a path.

`$Revision$'
     The revision number assigned to the revision.

`$Source$'
     The full pathname of the RCS file.

`$State$'
     The state assigned to the revision.  States can be assigned with
     `cvs admin -s'--see *Note admin options::.



HTH.

--KW 8-)
-- 
Keith Wansbrough <kw217 at cl.cam.ac.uk>
http://www.cl.cam.ac.uk/users/kw217/
University of Cambridge Computer Laboratory.





More information about the darcs-users mailing list