OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Subject: CVS (Was Re: DOCBOOK-APPS: A perspective on DocBook and DSSSL)


> I do not understand yet how to maintain version numbers of documents
> automatically? I want to keep the source in CVS and tag each new version
> with version number and want that built automatically into the document.
> Some of this can be done with CVS tags and replacements etc.

I keep all my docs, images and even my customized stylesheets in a 
CVS repository.  I also tag the repository when I hit a certain
version number.  Yes, *some* of this can be done with CVS keyword
replacement, although I don't know of a CVS keyword that will be 
replaced with the current *tag* of the file.  Chapter 12 of the
Cederqvist manual (http://www.cvshome.org/docs/manual/cvs_12.html#SEC98)
talks about keyword expansion but shows no keyword for the tag.

At the top of most of my SGML files I put a comment string in that
initially looks like:

  <!-- $Id$ -->

but once the file is checked in it becomes something like:

  <!-- $Id: userguide.sgml,v 1.77 2001/04/11 14:35:45 dyork Exp $ -->

(this particular file has been committed 77 times.)

It would certainly be possible to use the $Revision$ keyword 
somewhere in the main text of the document. Something like:

  <para>This is $Revision$ from $Date$. </para>

Which CVS would expand into the rather ugly:

  <para>This is $Revision: 1.2$ from $Date: 2001/04/17 19:15:44 $. </para>

Note that you could when you were ready to publish the docs, you could
do a 'cvs update -kv' or a 'cvs co -kv' to update or checkout the CVS
module with replacing the keyword VALUES so that you get:

  <para>This is 1.2 from 2001/04/17 19:15:44. </para>

But of course now you would need to supply the word "Revision" or 
whatever text you want.  The only problem, as described in
http://www.cvshome.org/docs/manual/cvs_12.html#SEC102 is that
further keyword substitutions are now not possible.  My suggestion
would be to use it with 'cvs export' along the lines of:

 cvs -d path-to-cvs-repository export -r tagname -d targetdir -kv modulename

where 'tagname' is whatever you have tagged it at, and 'targetdir' is the
directory where you want your exported files to go to.  (And of course
you can drop the initial '-d path' if you have the env variable CVSHOME
set to the root of your repository.)

You would then have a separate directory with the exported SGML files
with the values of the keywords replaced which you could process and
publish... and then simply delete the temporary directory.

My 2 cents,

Dan York, Director of Training        dyork@e-smith.com
Ph: +1-613-751-4401  Mobile: +1-613-263-4312 Fax: +1-613-564-7739 
e-smith, inc. 150 Metcalfe St., Suite 1500, Ottawa,ON K2P 1P1 Canada
http://www.e-smith.com/            open source, open mind

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]

Powered by eList eXpress LLC