changeset 35544:8494944940e5

log: use smartset.slice() to limit number of revisions to be displayed
author Yuya Nishihara <yuya@tcha.org>
date Sun, 22 Oct 2017 23:04:07 +0900
parents a7f7eff4ec08
children 349bcd7fa670
files mercurial/cmdutil.py
diffstat 1 files changed, 1 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/cmdutil.py	Thu Jan 04 10:51:41 2018 +0900
+++ b/mercurial/cmdutil.py	Sun Oct 22 23:04:07 2017 +0900
@@ -2528,13 +2528,7 @@
         matcher = revset.match(repo.ui, expr)
         revs = matcher(repo, revs)
     if limit is not None:
-        limitedrevs = []
-        for idx, rev in enumerate(revs):
-            if idx >= limit:
-                break
-            limitedrevs.append(rev)
-        revs = smartset.baseset(limitedrevs)
-
+        revs = revs.slice(0, limit)
     return revs, expr, filematcher
 
 def _parselinerangelogopt(repo, opts):