From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/5053 Path: main.gmane.org!not-for-mail From: Hartmut Henkel Newsgroups: gmane.comp.tex.context Subject: Re: Versionnumbers Date: Thu, 12 Jul 2001 21:00:04 +0200 (CEST) Sender: owner-ntg-context@let.uu.nl Message-ID: References: <3.0.6.32.20010712091736.019cd600@server-1> NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1035395670 30863 80.91.224.250 (23 Oct 2002 17:54:30 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Wed, 23 Oct 2002 17:54:30 +0000 (UTC) Cc: ntg-context Original-To: Hans Hagen In-Reply-To: <3.0.6.32.20010712091736.019cd600@server-1> Xref: main.gmane.org gmane.comp.tex.context:5053 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:5053 You can put the macro call \scanrcs $Id$ into the source file whereever you like, but regarding TeX, the \scanrcs macro has to be defined before. At the first time when you submit the file by ci, the string $Id$ will be replaced by the expanded string (still delimited by `$Id' and `$') with date, version number, etc. inbetween. Obviously only from that moment on the simple macro below is working, because it expects the full number of macro parameters. The rcs system (consisting of programs ci, co, rlog...) itself does not care where or how often it finds a string $Id$ or the expanded version in a file. It simply replaces all occurences by updated, identical ones. These strings need not be at file or line begin. E. g. you can simply write %$Id$ to keep the string away from TeX. There are other strings detected by rcs, like $Log$, $Revision$, $Author$, $Date$ etc., which mostly produce substrings of the full $Id$ string. See the co man-pages. There should exist also a LaTeX package for handling rcs, but I never used it, since it is fun writing three lines of macro and seeing TeX running over it :-) I forgot: ci produces a repository file `,v', e.g. foo.tex,v, which incrementally keeps ALL versions: The latest version is stored literally, and older versions are stored incrementally as differences. The automatic version number incrementing uses diff to detect file changes. If you create a subdirectory `RCS' in the current directory, repository files are kept there. The really good point about rcs is, that you can recover any older file version by version number. There is also the cvs system around, which puts a layer of functionality on top of rcs, and allows managing repositories over the Internet. Best Regards Hartmut On Thu, 12 Jul 2001, Hans Hagen wrote: > At 11:03 PM 7/11/01 +0200, Hartmut Henkel wrote: > >You might use `rcs', revision control system. This stamps your files > >with an Id string, containing filename, -version, -date, creator... > > > >You submit e. g. the file foo.tex by ci foo.tex. You get the new version > >for editing by typing co -l foo.tex > > > >In plain TeX the following macro scans the Id string, when you have > >initially included a line \scanrcs $Id$ into your input file: > > > >% begin of file foo.tex > >\def\scanrcs $#1 #2,v #3 #4/#5/#6 #7 #8 #9 ${% > > \def\fileversion{#3} > > \def\filedate{#4#5#6} % Or whatever date format you like > > } > > > >\scanrcs $Id: foo.tex,v 1.1 2001/07/11 20:49:46 hahe Exp hahe $ > > > >\fileversion > >\bye > >% end of file foo.tex > > > >E. g. this prints `1.1', the current version. > > > >Should be transferable also to ConTeXt, but don't have experience with > >it. > > Where is this line put? At the top of a file? In a separate file? In > principle reading such a line could be automated [i.e. hooked into \starttext] > > Hans ------------------------------------------------------------------------ Dr.-Ing. Hartmut Henkel In den Auwiesen 6, D-68723 Oftersheim, Germany E-Mail: hartmut_henkel@gmx.de http://www.circuitwizard.de ------------------------------------------------------------------------