[patch] improved ignore pattern matching (#57637)

John Arbash Meinel john at arbash-meinel.com
Fri Dec 8 13:41:31 GMT 2006


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

Don't forget to "Reply to All" so that the list gets emailed as well.

Kent Gibson wrote:
> 
> 
> John A Meinel wrote:
> 
>> I think it might be easier to follow if we broke: +    def
>> test_char_groups(self)
> 
>> So that it was multiple calls to 'self.assertMatches' rather than a
>> giant list, that you try to decipher before you find out what is
>> being done with it.
> 
> Are you just referring to that one test case, or all of them?
> (cos I changed them all from repeated called to assertMatch because I
> found it hard to read ;-).
> 
> If you are just referring to that one case then maybe you don't
> understand what I was trying to do.  The list is used twice, once to
> test the basename matcher and a second time to test the fullpath
> matcher (by prefixing the pattern with './').  If I rearrange that to
> call assertMatch directly for each (pattern,positive,negative) say for
> basename, then I will need to repeat the whole test case for
> fullpath.  I'd rather not have to define all those patterns twice.

> 
> OTOH I agree that that test case is both long and a bit convoluted.
> How about I refactor it based on the sub-group being tested (digit,
> alnum, ...)?  That would result in more bite sized tests.
> 

Probably it would be clearer as you say, broken up by test type.

You could also write a helper that takes a list, and runs assertMatches
twice.

> I've made all the other changes you suggest.
> I thought I had fixed the typo before, but obviously not.
> And I told Jan I was going to rename the module from glob.py since it
> was no longer a plugin replacement for the python module, but I never
> could decide on a name.
> I was going to use "shell_glob" but then we abandoned mimicking shell...
> Anyway I've gone with "globbing".
> 
> And wrt flush_ignore_list_cache being private, at the time I was
> worried about plugins messing with the runtime ignores and needing a
> mechanism to flush the cache.
> Of course that is a bad fix anyway - the workingtree should be
> modified to detect if the ignores are dirty and rebuild the cache
> automatically.
> 
> Cheers,
> Kent.

I see your point, but plugins generally only alter the global list
before the tree is created. And certainly they wouldn't know what
WorkingTrees have been created. So for now, I'm not sure it is something
you really need to worry about. I can see what you are trying to do, but
without the rest of the puzzle being done, it doesn't really work.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFeWuLJdeBCYSNAAMRAuxSAKCM3M3hm9pmhYtJ/gtpMJCOf8KGBQCggBH1
vZ4pIOCTC9vtnpCmzUnnuTY=
=KgW2
-----END PGP SIGNATURE-----




More information about the bazaar mailing list