[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: Martin Furter <mf_at_rola.ch>
Date: Wed, 26 Mar 2008 00:49:07 +0100 (CET)

On Thu, 20 Mar 2008, John Peacock wrote:

> Mycroft Holmes wrote:
>> the most general approach is to have a macro that resolves to an _integer_
>> literal.
>> this enables, for example, statements like:
>>
>> #if SVN_VERSION < 3000
>
> Please do as I suggested and look at the existing Subversion subst.c code and
> see if you can suggest something useful. This "meta design" discussion is
> not helpful.
>
> These are the design limitations of the current keywords support:
>
> 1) All keywords must be delimited by a known [single] character (currently
> hardcoded to '$'), in order to be parsed from the character stream;
>
> 2) All keywords must be stored unexpanded in the repository (to mark their
> location) and will only be expanded in a working copy (or checkout) by the
> client code;
>
> 3) All expanded keywords must include the keyword as part of the expansion
> (so that the WC client code can unexpand them again while performing diff,
> for example);
>
> 4) Expanded keywords cannot span multiple lines.

If custom keywords could contain text and variables it could be done the
following way:

Define a keyword $commentrev$ which expands to (where 1234 is the rev):
   $commentrev: */ 1234 /* $

Use it like this:
#define SVN_VERSION /* $commentrev$ */

Expanded it would look like this:
#define SVN_VERSION /* $commentrev: */ 1234 /* $ */

Just a random idea I had...
Sorry for the noise.
Martin

---------------------------------------------------------------------
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-26 00:49:23 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.