Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 18711:6b786dc88612
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.
author | Bryan O'Sullivan <bryano@fb.com> |
---|---|
date | Wed, 20 Feb 2013 11:31:41 -0800 |
parents | f17680992123 |
children | c0087d48ec3a |
comparison
equal
deleted
inserted
replaced
18710:49ef9d0ca815 | 18711:6b786dc88612 |
---|---|
4213 revmatchfn = matchfn | 4213 revmatchfn = matchfn |
4214 | 4214 |
4215 displayer.show(ctx, copies=copies, matchfn=revmatchfn) | 4215 displayer.show(ctx, copies=copies, matchfn=revmatchfn) |
4216 | 4216 |
4217 for ctx in cmdutil.walkchangerevs(repo, matchfn, opts, prep): | 4217 for ctx in cmdutil.walkchangerevs(repo, matchfn, opts, prep): |
4218 if displayer.flush(ctx.rev()): | |
4219 count += 1 | |
4218 if count == limit: | 4220 if count == limit: |
4219 break | 4221 break |
4220 if displayer.flush(ctx.rev()): | |
4221 count += 1 | |
4222 displayer.close() | 4222 displayer.close() |
4223 | 4223 |
4224 @command('manifest', | 4224 @command('manifest', |
4225 [('r', 'rev', '', _('revision to display'), _('REV')), | 4225 [('r', 'rev', '', _('revision to display'), _('REV')), |
4226 ('', 'all', False, _("list files from all revisions"))], | 4226 ('', 'all', False, _("list files from all revisions"))], |