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

Augie Fackler raf at durin42.com
Tue Feb 19 20:01:31 CST 2013


Both of these LGTM

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



More information about the Mercurial-devel mailing list