[RFC/MERGE] _RulesSearcher.get_selected_items should return consistent output

John Arbash Meinel john at arbash-meinel.com
Thu Apr 16 23:13:31 BST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Marius Kruger wrote:
> Hi
> I was surprised that _RulesSearcher.get_selected_items
> :return: () if no rule matched, otherwise a sequence of name,value
>           tuples. The sequence is the same length as names,
>           tuple order matches the order in names, and
>           undefined preferences are given the value None.
> 
> I expected it to always return (('foo', None), ('bar', None))  for
> names=('foo','bar'), even if no rules were found for the path
> (and not () as per the current behaviour).
> 
> I fixed my plugin code to compensate for the current behaviour so I
> don't really need this,
> but I thought maybe others would also find this strange, so here's a
> simple patch.
> I thought I'd get some feedback before going so far as writing a test
> (you know, maybe I'm way off track with this again :).
> 
> 

I would go back and read the thread where Ian was introducing this, as I
remember discussing it directly back then.

I think his idea was to allow for "shortcutting" when there were no
rules to match, which then also allows the next higher level to
shortcut, etc.

I'm not 100% positive how the decision came out, just that it has
certainly been discussed before.

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknnrYsACgkQJdeBCYSNAANjLACgtuEQJceRniB0WkIk1rtqqqbn
D2kAn3gNM184Gw3u5cW1CPGZjcT+8VDt
=NToM
-----END PGP SIGNATURE-----



More information about the bazaar mailing list