[PATCH] cascading lookup support in LocationConfig (bug 33430)
Aaron Bentley
aaron.bentley at utoronto.ca
Mon Sep 11 14:28:43 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
James Henstridge wrote:
> On 08/09/06, Aaron Bentley <aaron.bentley at utoronto.ca> wrote:
>> exact?
> "exact" seems to be more appropriate for the existing "recurse=False"
> mode (which I've preserved). I'll try to explain what I mean with an
> example.
Ah, see I thought you were talking about a flag for get_user_value
methods, not for sections.
So get_user_value('push_location', exact=True) would not match recursive
sections. (or at least, not unless they were exact matches.)
For what you meant, maybe ignore_parents?
> LocationConfig seemed the most appropriate place given how the
> existing code worked, but I guess we can change that.
>
>
>> If I query for "/home/abentley/bzr/nested-trees", I'd like to get back
>> ("sftp://panoramicfeedback.com/var/www/opensource/bzr",
>> "/nested-trees"). That would let me produce the url
>> "sftp://panoramicfeedback.com/var/www/opensource/bzr/nested-trees",
>> which I think is a much better result.
>
>
> I wonder if this indicates that the decision on whether to cascade
> should be decided on a key-by-key basis?
It's possible.
> The "push" config key definitely shouldn't cascade (unless it can
> adjust the path like you've sketched out here), so the current
> behaviour is a potential source of bugs.
Well, that doesn't seem to be true of the submit location, so I wonder
if it's true for the push location. Might you have multiple branches,
all with the same push target?
> Other keys we'd pretty much always want to cascade, such as "email".
>
> Would it make sense to expose the two behaviours to the rest of the
> code, or provide a way to register the policy for particular key
> names. What do you think?
I think BranchConfig should set policy about whether particular values
cascade. LocationConfig can provide an API for specifying what you
want, or provide enough information to determine whether the match was
exact, as I discussed.
Can I ask what you think about the order of matching I've suggested?
(i.e. exact LocationConfig, TreeConfig, recursive LocationConfig,
GlobalConfig?) I'm not really satisfied with it. Although it seems
correct, in a certain sense, it also seems confusing.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFFBWSL0F+nu1YWqI0RAiwEAJ40Hcf2VW237BD0krKJLnCRNbHGoQCghy4O
LX0YJTuLkkh2etS6MFdMYFc=
=mGFm
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list