[PATCH 3 of 8 STABLE RFC] largefiles: use duplicated 'match' object to modify it

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Sat Feb 18 02:31:33 CST 2012


At Fri, 17 Feb 2012 14:14:37 -0600,
Matt Mackall wrote:
> 
> On Sat, 2012-02-18 at 01:07 +0900, FUJIWARA Katsunori wrote:

> > diff -r 7a58a75274f8 -r 5a568b210fe5 hgext/largefiles/reposetup.py
> > --- a/hgext/largefiles/reposetup.py	Sat Feb 18 01:02:52 2012 +0900
> > +++ b/hgext/largefiles/reposetup.py	Sat Feb 18 01:02:52 2012 +0900
> > @@ -172,8 +172,10 @@
> >                          orig_ignore = lfdirstate._ignore
> >                          lfdirstate._ignore = _ignoreoverride
> >  
> > +                        match = copy.copy(match)
> >                          match._files = [f for f in match._files if f in
> >                              lfdirstate]
> > +                        match._fmap = set(match._files)
> >                          # Don't waste time getting the ignored and unknown
> >                          # files again; we already have them
> >                          s = lfdirstate.status(match, [], False,
> 
> I have to note that the fact that we have to do these sorts of
> machinations repeatedly in largefiles smells like we're missing some
> fundamental way to simplify the whole thing. One suspects that there's a
> way to isolate all the knowledge of standins to a much smaller piece of
> code so that things like the matcher never care. And if you get the
> abstraction right, huge classes of bugs vanish.

For 'match', I'm just working for encapsulation of this kind
modification as a part of case insensitive filesystem support.

But encapsulation of standin handling itself is better than it from
higher point of view, as you say.

----------------------------------------------------------------------
[FUJIWARA Katsunori]                             foozy at lares.dti.ne.jp


More information about the Mercurial-devel mailing list