[PATCH] largefiles: optimize status when files are specified on the command line (issue3144)

Na'Tosha Bard natosha at unity3d.com
Fri Dec 9 11:16:46 CST 2011


2011/12/9 Martin Geisler <mg at aragost.com>

> Na'Tosha Bard <natosha at unity3d.com> writes:
>
> > # HG changeset patch
> > # User Na'Tosha Bard <natosha at unity3d.com>
> > # Date 1323442785 -3600
> > # Node ID 46fb85de1dc5e2a9075ec237f0cccb1d136ef760
> > # Parent  fc8c7a5ccc4a928e7559013ecdf50462c271418c
> > largefiles: optimize status when files are specified on the command
> > line (issue3144)
>
> The lines in your commit message are very long. I prefer them
> hard-wrapped at around 70 characters -- that way they're easier to read
> in terminals.
>

OK, I'll fix it.


>  > diff -r fc8c7a5ccc4a -r 46fb85de1dc5 hgext/largefiles/reposetup.py
> > --- a/hgext/largefiles/reposetup.py   Thu Dec 08 16:01:44 2011 -0600
> > +++ b/hgext/largefiles/reposetup.py   Fri Dec 09 15:59:45 2011 +0100
> > @@ -120,6 +120,23 @@
> >                  if match is None:
> >                      match = match_.always(self.root, self.getcwd())
> >
> > +                # First check if there were files specified on the
> > +                # command line.  If there were, and none of them were
> > +                # largefiles, we should just bail here and let super
> > +                # handle it -- thus gaining a big performance boost.
> > +                lfdirstate = lfutil.openlfdirstate(ui, self)
> > +                if match._files:
> > +                    matchedfiles = [f for f in match._files if f in
> lfdirstate]
> > +                    if not matchedfiles:
> > +                        try:
> > +                            return super(lfiles_repo,
> self).status(node1, node2,
> > +                                         match, listignored, listclean,
> > +                                         listunknown, listsubrepos)
> > +                        except TypeError:
> > +                            return super(lfiles_repo,
> self).status(node1, node2,
> > +                                         match, listignored, listclean,
> > +                                         listunknown)
>
> These TypeErrors wont be thrown -- they were a left-over from when the
> code was compatible with pre-1.7 versions of Mercurial. I just removed
> the other instances of this pattern I could find.
>

OK, I'll remove them.


>  >                  # Create a copy of match that matches standins instead
> >                  # of largefiles.
> >                  def tostandin(file):
> > @@ -155,7 +172,8 @@
> >                          # taken out or lfdirstate.status will report an
> error.
> >                          # The status of these files was already
> computed using
> >                          # super's status.
> > -                        lfdirstate = lfutil.openlfdirstate(ui, self)
> > +                        if not lfdirstate:
> > +                            lfdirstate = lfutil.openlfdirstate(ui, self)
>
> Can lfdirstate be None now? I don't see a change (in your patch) that
> would make that possible.
>

Well, no -- I think this was leftover from a previous version of the
patch.  I'll take it out.

Cheers,
N.

-- 
*Na'Tosha Bard*
Build & Infrastructure Developer | Unity Technologies

*E-Mail:* natosha at unity3d.com
*Skype:* natosha.bard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20111209/bbd0ff4c/attachment.html>


More information about the Mercurial-devel mailing list