[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: hint for improved keyword substitution

From: Troy Curtis Jr <troycurtisjr_at_gmail.com>
Date: Wed, 19 Mar 2008 06:12:01 -0500

On Wed, Mar 19, 2008 at 3:52 AM, Mycroft Holmes <psion.s5_at_gmail.com> wrote:
>
> On 18 Mar 2008, at 20:34, John Peacock wrote:
>
> > That's not going to be possible, because the keyword stuff is
> > strictly line-oriented (by which I mean that it only reads and
> > processes a single line at a time).
> >
>
>
> if this is a problem, I'll modify my proposal: let the $template$ be
> slightly customizable.
> for example instead of replacing "$REV$" with "$REV: nnnn $" I'd like
> svn to replace "// REV$" with "nnnn // REV: nnnn$"
> (note that the ": nnnn" part is necessary to match the leftmost
> "nnnn" in a second pass)
>
> this will do, because I can write
>
> #define VERSION // REV$
>
> and svn will change to
>
> #define VERSION 1234 // REV: 1234$
>
>
>
>
>
>
> > Perhaps you would like this instead?
> >
> > http://subversion.tigris.org/faq.html#version-value-in-source
>
> no :)
> because I want finer granularity: in my project, each source file has
> its own version number, as an integer (not as a string).
> at the moment the only way to get this is:
>
> 1) every file X.h starts with
> #include "version/X.txt"
>
> (note that this is bad practice, since every file must know its own
> name...)
>
> the companion text files (which are not versioned) just state:
> #define SVN_REV nnnn
>
> 2) before building, preprocess every file and generate all the
> companion files parsing 'svn info' ...
>
>
> but this procedure is going to cause BIG problems, since code CHECKED
> OUT will build, but code EXPORTED from the repo will not!
> so I'm firmly convinced this is an issue for svn.
> furthermore, I don't see any practical use for keyword substitution
> AS IS, except cosmetic (?) reasons (don't tell me that $REV: nnnn$ is
> pleasant :)
>
>

Of course SCCS, RCS, and CVS (and I'm sure other version control systems) have
used this method successfully for a very long time...

Troy

-- 
Beware of spyware. If you can, use the Firefox browser. - USA Today
Download now at http://getfirefox.com
Registered Linux User #354814 ( http://counter.li.org/)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-03-19 12:12:24 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.