From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/38783 Path: news.gmane.org!not-for-mail From: Robin Kirkham Newsgroups: gmane.comp.tex.context Subject: Re: Module for svn info Date: Wed, 23 Jan 2008 22:52:03 +1100 Message-ID: <9730C7E5-C518-460A-9F1D-5211BAEA1421@csiro.au> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v753) Content-Type: multipart/mixed; boundary="===============1682892038==" X-Trace: ger.gmane.org 1201089808 13270 80.91.229.12 (23 Jan 2008 12:03:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Jan 2008 12:03:28 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Wed Jan 23 13:03:46 2008 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1JHeKY-0000N4-H8 for gctc-ntg-context-518@m.gmane.org; Wed, 23 Jan 2008 13:03:46 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C5BEB1FC57; Wed, 23 Jan 2008 13:03:20 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 08400-02; Wed, 23 Jan 2008 13:02:47 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9FB441FC5D; Wed, 23 Jan 2008 13:02:47 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id F35291FC5D for ; Wed, 23 Jan 2008 13:02:46 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 01793-02-6 for ; Wed, 23 Jan 2008 13:02:09 +0100 (CET) Original-Received: from mx1.aanet.com.au (mx.aanet.com.au [202.63.43.136]) by ronja.ntg.nl (Postfix) with ESMTP id D93E91FC54 for ; Wed, 23 Jan 2008 13:02:08 +0100 (CET) Original-Received: from mail.aanet.com.au (mail.aanet.com.au [202.61.184.228]) by mx1.aanet.com.au (Postfix) with SMTP id B12E92D7905 for ; Wed, 23 Jan 2008 21:52:20 +1000 (EST) Original-Received: (qmail 8300 invoked by uid 89); 23 Jan 2008 11:52:05 -0000 Original-Received: by simscan 1.2.0 ppid: 8202, pid: 8249, t: 0.5119s scanners: attach: 1.2.0 clamav: 0.88.1/m:37/d:1390 Original-Received: from cust5289.vic01.dataco.com.au (HELO ?192.168.1.12?) (202.164.198.169) by mail.aanet.com.au with SMTP; 23 Jan 2008 11:52:04 -0000 In-Reply-To: X-Mailer: Apple Mail (2.753) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:38783 Archived-At: --===============1682892038== Content-Type: multipart/alternative; boundary=Apple-Mail-27--556376182 --Apple-Mail-27--556376182 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed > Hi Ernesto, > hi Robin, > > thanks for your replies. > > The thing I like most with your solution is that svnversion provides a > modify flag, so I can see whether all changes have been cheched in. =20= > Great. > > A little drawback is that all files under the current path are used to > determine the version. If theres a file in the path which is not part > of the document changes to this file will also change the revision of > the document. But I think this can be easily prevented by placing > every document into an own directory. > > What do you think of using: > > \def\SVNVERSION{svnversion -n > svnversion.tex} > > \ifeof18 > \installprogram{\SVNVERSION}% > \else > \executesystemcommand{\SVNVERSION}% > \fi That is nicer of course ... I just do it outside the document in a =20 Makefile because I'm used to doing that sort of thing. I imagine the only uncompromised way to extract an svn revision (or =20 revision range) that covers the whole document accurately is to write =20= a script that extracts the source file names from the previous =20 logfile (or somewhere), individually determines their revision using =20 "svn status" (to get modified status), and constructs an overall =20 result. I guess some embedded Lua could do that pretty easily and =20 portably. It would also catch files that are often outside the =20 immediate document directory (in particular, bib files). > Ernesto Schirmacher schrieb: >>> If your sources are in svn, then they actually have the same svn- >>> number, after a commit. But the numbers in the $Revision$ or >>> $Id$ tags of your working copies are not updated by svn commit. >>> However, if you do an "svn update" after the commit, it should >>> update the numbers. > > This is not true. The complete name of $Rev=A7$ is > $LastChangedRevision$. It's the revision of the last change to this =20= > file. Quite right, my apologies. An "svn update" does however alter the =20 output of "svnversion", for instance if it indicates a mixed revision =20= (1234:3456), after an update it will be just 3456. Best, Robin= --Apple-Mail-27--556376182 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1

Hi Ernesto,

hi Robin,


thanks for your replies.


The = thing I like most with your solution is that svnversion provides = a

modify flag, so I can see whether all changes have been cheched = in. Great.


A little drawback is that all files = under the current path are used to

determine the version. If theres a file in the path = which is not part

of the document changes to this file will also change the = revision of

the document. But I think this can be easily prevented by = placing

every = document into an own directory.


What = do you think of using:


\def\SVNVERSION{svnversion = -n > svnversion.tex}


\ifeof18

=A0 =A0 = \installprogram{\SVNVERSION}%

\else

=A0= =A0 \executesystemcommand{\SVNVERSION}%

\fi


That is nicer of course ... I = just do it outside the document in a Makefile because I'm used to doing = that sort of thing.


I imagine the = only uncompromised way to extract an svn revision (or revision range) = that covers the whole document accurately is to write a script that = extracts the source file names from the previous logfile (or somewhere), = individually determines their revision using "svn status" (to get = modified status), and constructs an overall result. I guess some = embedded Lua could do that pretty easily and portably. It would also = catch files that are often outside the immediate document directory (in = particular, bib files).


Ernesto Schirmacher schrieb:

If your sources are in svn, then they actually have = the same svn-

=A0number, = after a commit. But the numbers in the $Revision$ or

$Id$ tags of your working = copies are not updated by svn commit.

However, if you do an "svn update" = after the commit, it should

update the numbers.

=


This is not true. The complete name = of $Rev=A7$ is

$LastChangedRevision$. It's the revision of the last change = to this file.


Quite right, = my apologies. An "svn update" does however alter the output of = "svnversion", for instance if it indicates a mixed revision (1234:3456), = after an update it will be just 3456.=A0


Best,


Robin

= --Apple-Mail-27--556376182-- --===============1682892038== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============1682892038==--