[MERGE] internal glob expansion for all commands on win32 and for invocations from the test suite
Aaron Bentley
aaron.bentley at utoronto.ca
Thu Aug 9 14:25:33 BST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Kuno Meyer wrote:
>> On Thu, 2007-08-09 at 00:19 +0200, Kuno Meyer wrote:
>>> --- bzrlib/win32utils.py 2007-07-24 19:40:40 +0000
>>> +++ bzrlib/win32utils.py 2007-08-08 22:13:53 +0000
>>> @@ -266,7 +266,7 @@
>>> Introduced in bzrlib 0.18.
>>> """
>>> if not file_list:
>>> - return []
>>> + return file_list
>>> import glob
>>> expanded_file_list = []
>>> for possible_glob in file_list:
>>
>> This change seems spurious and makes the function harder to use as
>> demonstrated elsewhere in your patch where you have to make sorting and
>> using it optional.
>>
>> Why have you made this change?
>
> It was necessary because of failing blackbox tests. I can remember the ones for the inventory command (my observation: None->all files, []->no file), but perhaps there were more.
I like this. I would much rather interpret no arguments as None, not
[]. If we don't do it during argument parsing, we'll have to duplicate
the effort all over the codebase.
>> [it] makes the function harder to use as demonstrated elsewhere in
>> your patch where you have to make sorting and using it optional
You can just compare sets instead of sorting, though. That's arguably
clearer in intent. set([]) has the same effect as set().
I think it would be clearer as:
if file_list is None:
return None.
(The [] case falls neatly out of the code anyway.)
I think it doesn't make sense to skip the test_tree_unicode and
test_tree_ascii tests on *nix. Those are only failing because you're
testing case-sensitivity *and* unicode/ascii. You can separate the
case-sensitivity out into a separate test, and
requireFeature(CaseInsensitiveFilesystem).
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGuxXM0F+nu1YWqI0RAlWZAJ0WX3U07dtujk26t5zW1hR3PaJ03QCeNe+D
Azh/LNCEPoCnxMslZlB/eD0=
=RFci
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list