[PING][RFC][MERGE] alias to respect spaces in quoted arguments

John Arbash Meinel john at arbash-meinel.com
Mon Nov 27 13:50:51 GMT 2006


Marius Kruger wrote:
...

> My problem is, that the method in comands.py also creates
> a new GlobalConfig() object, which will obviously not parse
> the file content I set in my test.
> My conclusion was thus that every time config.GlobalConfig ()
> is called, that the config is read anew. I would like us to
> store a instance of the GlobalConfig config somewhere,
> and just load it (lazily) and use the same instance everywhere,
> so that we don't parse the file a million times.

I agree with the sentiment, but we need to be a little careful about
object lifetime. Because 'bzrlib' is meant to be used as a library, and
thus has the potential to be used by a GUI front end, which stays open
for as long as weeks at a time. With 'bzr' the command line front end,
no single command stays open long enough that it really matters. One
thing we could do is just keep a cache tied to a stat value. Everytime
the global config is requested, we stat the file and see if any info has
changed. If not, we return what we already parsed.

I'm not sure if it is a big win, since I don't think parsing the global
config should take a very long time. But if you really want to avoid it,
I think this would be a decent way to do it.

John
=:->



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061127/9312946b/attachment.pgp 


More information about the bazaar mailing list