[PATCH][MERGE] Improvements to is_ignored

Jan Hudec bulb at ucw.cz
Wed Jan 11 06:21:14 GMT 2006


On Tue, Jan 10, 2006 at 22:35:07 -0600, John A Meinel wrote:
> Martin Pool wrote:
> > On 10 Jan 2006, John A Meinel <john at arbash-meinel.com> wrote:
> >> Jan Hudec wrote:
> > 
> >> Here are my results:
> >> time bzr status
> >> real    0m8.374s
> >> user    0m7.840s
> >> sys     0m0.404s
> >>
> >> time bzr.ignore/bzr status
> >> real    0m5.497s
> >> user    0m4.988s
> >> sys     0m0.412s
> > 
> > Very nice.
>
> >> So it was able to shave a lot of the time off. This is with 71 ignore
> >> patterns, and 805 ignored files.
> >>
> >> I also found an interesting problem if you don't use (?:), specifically:
> >> bzr: ERROR: exceptions.AssertionError: sorry, but this version only
> >> supports 100 named groups
> >>   at /usr/lib/python2.4/sre_compile.py line 506
> >>   in compile

Ouch.

Well, at least we need to call is_ignored before calling is_ignored_by, so we
don't iterate over anything unless when we are not going to find anything
(especially since that is the worst case).

> > So we should add a test with enough patterns to provoke this, calling
> > both bzr status and bzr ignored.

Ok, I'll look at it tomorrow.

> I agree.
> 
> Also, I found a small advantage to using the pattern (a$)|(b$)|(c$)
> versus doing ((a)|(b)|(c))$.
> Which is nice, because it is easier to do.

... and which it does because it still uses fnmatch.translate, which
always ends it's result with $.

-- 
						 Jan 'Bulb' Hudec <bulb at ucw.cz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060111/2860fa68/attachment.pgp 


More information about the bazaar mailing list