log: remove redundant handling of --limit
authorYuya Nishihara <yuya@tcha.org>
Sun, 22 Oct 2017 22:38:16 +0900
changeset 35545 349bcd7fa670
parent 35544 8494944940e5
child 35546 5e1d4ccab455
log: remove redundant handling of --limit A returned 'revs' set is pre-filtered by cmdutil.getlogrevs(). The result of displayer.flush() isn't used anymore, so removed.
mercurial/cmdutil.py
mercurial/commands.py
--- a/mercurial/cmdutil.py	Sun Oct 22 23:04:07 2017 +0900
+++ b/mercurial/cmdutil.py	Sun Oct 22 22:38:16 2017 +0900
@@ -1585,8 +1585,6 @@
         if rev in self.hunk:
             self.ui.write(self.hunk[rev])
             del self.hunk[rev]
-            return 1
-        return 0
 
     def close(self):
         if self.footer:
--- a/mercurial/commands.py	Sun Oct 22 23:04:07 2017 +0900
+++ b/mercurial/commands.py	Sun Oct 22 22:38:16 2017 +0900
@@ -3433,9 +3433,6 @@
         elif filematcher is None:
             filematcher = lrfilematcher
 
-    limit = cmdutil.loglimit(opts)
-    count = 0
-
     getrenamed = None
     if opts.get('copies'):
         endrev = None
@@ -3446,8 +3443,6 @@
     ui.pager('log')
     displayer = cmdutil.show_changeset(ui, repo, opts, buffered=True)
     for rev in revs:
-        if count == limit:
-            break
         ctx = repo[rev]
         copies = None
         if getrenamed is not None and rev:
@@ -3466,8 +3461,7 @@
             revhunksfilter = None
         displayer.show(ctx, copies=copies, matchfn=revmatchfn,
                        hunksfilterfn=revhunksfilter)
-        if displayer.flush(ctx):
-            count += 1
+        displayer.flush(ctx)
 
     displayer.close()