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

Re: svn commit: rev 5180 - trunk/subversion/libsvn_subr

From: Branko Čibej <brane_at_xbc.nu>
Date: 2003-03-05 03:38:01 CET

Daniel Rall wrote:

>>Well, it's not the "defaults" section anyway, it's the "global" section,
>>isn't it? So those comments should be changed accordingly. I think.
>>
>>[DEFAULT] is something else. One of these days I'll hopefully have time
>>to implement variable expansion, then we'll have the full functionality
>>of ConfigParser.
>>
>>
>
>Is there an IZ number for this feature? Sounds like something that I
>could hack out.
>
>
No, I don't think so. However, the way variable expansion should work is
documented in Python's DonfigParser module, and in the #if 0-ed parts of
the README template in config_file.c. If you're going to attack this,
remember the following:

    * The expanded values must be allocated from cfg->x_pool, not from
      cfg->pool. Once the value has been expanded, set option->expaded
      to TRUE, so that the next svn_config_get doesn't go expanding
      stuff again.
    * If the option doesn't contain variable placeholders, set
      option->expanded to TRUE but leave option->x_value at NULL. Look
      at remove_expansions() and make_string_from_option() to see why.
    * If you find an expansion placeholder, but don't find the option
      referred to in the current section or [DEFAULT], *do not* remove
      the token from the value -- leave it in, and *do* set the x_value
      member.
    * The places where variable expansion is needed are marked in the
      source (search for "TODO:").

The point here is that, whenever the config_t is modified, all expanded
values are discarded (remove_expansions), so that the changes can be
incorporated in re-expansions at the next svn_config_get.

Oh, and while you're at it: please change the svn_config_get (and
make_string_from_option) interface to return a const char* directly,
instead of by reference. That was a totally broken decision on my part.

Happy hacking! :-)

-- 
Brane Čibej   <brane_at_xbc.nu>   http://www.xbc.nu/brane/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Mar 5 03:40:47 2003

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.