[MERGE] is_ignored improvements...

Robert Collins robertc at robertcollins.net
Thu May 18 15:14:08 BST 2006


On Thu, 2006-05-18 at 14:34 +0200, Jan Hudec wrote:
> On Thu, May 18, 2006 at 20:46:37 +1000, Robert Collins wrote:
> > On Wed, 2006-05-17 at 22:25 +0200, Jan Hudec wrote:
> > > Hello,
> > > 
> > > On Tue, May 16, 2006 at 19:03:40 +1000, Robert Collins wrote:
> > > > Jan Hudec was working on is_ignored improvements... they account for a
> > > > nontrivial amount of the time of a 'bzr add' call.
> > > > 
> > > > I was wondering if we can get the compatible replacement in - leaving
> > > > the format changing etc stuff for a later time.
> > > 
> > > Ok, here it is. All tests pass and there are some new tests for globs and
> > > ignore. Please review. For merging please use
> > > http://drak.ucw.cz/~bulb/bzr/bzr/matcher/ branch.
> > > 
> > > It splits the WorkingTree.is_ignored method to ignored, which returns just
> > > a boolean and ignored_by, which returns the pattern. is_ignored is deprecated
> > > forwarder to ignored_by (to remain compatible).
> > > 
> > > I fixed the WorkingTree.ignored_files method, but it's neither used anywhere
> > > nor tested. Perhaps it should be deprecated.
> > > 
> > > There is no zero_nine in bzrlib.symbol_versioning yet, so I just used
> > > zero_eight (just one deprecated method -- WorkingTree.is_ignored). Please fix
> > > as appropriate for the version that will eventually get the changes.
> > 
> > Thanks for this. I've had a good look at it, and I'm going to -1 it as
> > it stands.
> > 
> > The code is very complex compared to the current code, and we end up
> > with two apis rather than one. I'm working on a variation derived from
> > your work, which will combine the regexes but only need the single API.
> > I'll post that up shortly, and I'd appreciate your review on this, as I
> > know you put a lot of thought into the is_ignored work in your branch.
> 
> The two interfaces are there because python has arbitrary limit of 100
> match groups in a pattern. So if I wanted to tell which pattern matched
> (the user interface displays that), I had to do the match bunch at a
> time rather than all at once. But in many places just a boolean is
> wanted, so all patterns can be matched at once, without captures.
> 
> The code is more complex than necessary because I didn't remove all the
> stuff needed for switching between different glob types -- which is not
> needed when there is just one.

Heres my alternative patch, finished up:

I currently prefer this over the original patch you prepared because of
the preservation of API. I dont think many users will have more than 100
regexs, and it should perform just fine.

What do you think? Does this make the future improvements you are
working on harder? Is it a problem to take this variation?

Rob

-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: is_ignored-one-regex.patch
Type: text/x-patch
Size: 13614 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060519/3be4b1bd/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060519/3be4b1bd/attachment.pgp 


More information about the bazaar mailing list