From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Module for svn info
Date: Wed, 23 Jan 2008 08:34:04 -0400 (AST) [thread overview]
Message-ID: <alpine.DEB.0.9999.0801230758300.19507@nqv-yncgbc> (raw)
In-Reply-To: <4795D03D.9090109@scmb.de>
On Tue, 22 Jan 2008, Markus Bernhardt wrote:
> \def\SVNVERSION{svnversion -n > svnversion.tex}
>
> \ifeof18
> \installprogram{\SVNVERSION}%
> \else
> \executesystemcommand{\SVNVERSION}%
> \fi
Looks ok to me. Coming back to calculating the maximum of versions, this
is possible to do inside TeX. Here is a short proof of concept. We need a
two pass mechanism since revisions could be defined after they need to be
used.
\unprotect
\def\REVISION#1
{\doifdefinedelse{!!REVISION}
{\ifdim#1pt > \dimexpr1pt*\!!REVISION
\edef\!!REVISION{#1} \fi}
{\edef\!!REVISION{#1}}}
\definetwopasslist{REVISION}
% Execute this in the beginning of document
\def\initializeREVISION
{\gettwopassdata{REVISION}
\iftwopassdatafound
\xdef\getREVISION{\twopassdata}
\else
\def\getREVISION{Not Found}
\fi
\global\let\initializeREVISION\relax}
% Execute this at the end of document
\def\saveREVISION
{\savetwopassdata {REVISION} {\getREVISION} {\!!REVISION}}
\appendtoks \initializeREVISION \to \everystarttext
\appendtoks \saveREVISION \to \everystoptext
\protect
\starttext
File 1:\REVISION{10} \getREVISION
File 2:\REVISION{4} \getREVISION
File 3:\REVISION{14} \getREVISION
\stoptext
Now this just needs to be plugged into the command to get revision
information from svn tags.
Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________
next prev parent reply other threads:[~2008-01-23 12:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-21 23:58 Robin Kirkham
2008-01-22 3:10 ` Ernesto Schirmacher
2008-01-22 11:15 ` Markus Bernhardt
2008-01-23 12:34 ` Aditya Mahajan [this message]
[not found] <mailman.3280.1201040714.4317.ntg-context@ntg.nl>
2008-01-23 11:52 ` Robin Kirkham
2008-01-23 21:26 ` Peter Münster
-- strict thread matches above, loose matches on Subject: below --
2008-01-20 2:34 Markus Bernhardt
2008-01-20 5:11 ` Aditya Mahajan
2008-01-21 8:32 ` Markus Bernhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.0.9999.0801230758300.19507@nqv-yncgbc \
--to=adityam@umich.edu \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).