[PATCH 2 of 2] commands: exit from the log loop at the right time

Benoit Boissinot bboissin at gmail.com
Wed Feb 20 01:48:40 CST 2013


On Wed, Feb 20, 2013 at 3:01 AM, Augie Fackler <raf at durin42.com> wrote:

> Both of these LGTM
>

+1 (started reviewing before seeing the LGTM).

Thanks,

Benoit

>
> On Feb 19, 2013, at 6:47 PM, Bryan O'Sullivan <bos at serpentine.com> wrote:
>
> > # HG changeset patch
> > # User Bryan O'Sullivan <bryano at fb.com>
> > # Date 1361317587 28800
> > # Node ID 4dfcc703b38581beafbf85ba5ae971943ecb70d5
> > # Parent  77b02f572b752fcbec87f576564880ec1dc9023b
> > commands: exit from the log loop at the right time
> >
> > Previously, we'd run the iterator one more time than necessary,
> > potentially doing a lot of extra work in the process.
> >
> > diff --git a/mercurial/commands.py b/mercurial/commands.py
> > --- a/mercurial/commands.py
> > +++ b/mercurial/commands.py
> > @@ -4215,10 +4215,10 @@ def log(ui, repo, *pats, **opts):
> >         displayer.show(ctx, copies=copies, matchfn=revmatchfn)
> >
> >     for ctx in cmdutil.walkchangerevs(repo, matchfn, opts, prep):
> > +        if displayer.flush(ctx.rev()):
> > +            count += 1
> >         if count == limit:
> >             break
> > -        if displayer.flush(ctx.rev()):
> > -            count += 1
> >     displayer.close()
> >
> > @command('manifest',
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel at selenic.com
> > http://selenic.com/mailman/listinfo/mercurial-devel
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20130220/a2c96c4a/attachment.html>


More information about the Mercurial-devel mailing list