diff mercurial/commands.py @ 36003:fcde8946c553

logcmdutil: hold makefilematcher/makehunksfilter() by changesetpriner (API) This merges self.matchfn and self.show(matchfn) into self._makefilematcher, and does the same for hunksfilter. Because changesetprinter seems to have too many optional arguments, makefilematcher() and makehunksfilter() will be packed into one object by later patch.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 21 Jan 2018 14:07:52 +0900
parents f8ad57d24252
children dd77e36eabb6
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Jan 21 13:40:31 2018 +0900
+++ b/mercurial/commands.py	Sun Jan 21 14:07:52 2018 +0900
@@ -3450,7 +3450,10 @@
         getrenamed = templatekw.getrenamedfn(repo, endrev=endrev)
 
     ui.pager('log')
-    displayer = logcmdutil.changesetdisplayer(ui, repo, opts, buffered=True)
+    displayer = logcmdutil.changesetdisplayer(ui, repo, opts,
+                                              makefilematcher=filematcher,
+                                              makehunksfilter=hunksfilter,
+                                              buffered=True)
     for rev in revs:
         ctx = repo[rev]
         copies = None
@@ -3460,16 +3463,7 @@
                 rename = getrenamed(fn, rev)
                 if rename:
                     copies.append((fn, rename[0]))
-        if filematcher:
-            revmatchfn = filematcher(ctx)
-        else:
-            revmatchfn = None
-        if hunksfilter:
-            revhunksfilter = hunksfilter(ctx)
-        else:
-            revhunksfilter = None
-        displayer.show(ctx, copies=copies, matchfn=revmatchfn,
-                       hunksfilterfn=revhunksfilter)
+        displayer.show(ctx, copies=copies)
         displayer.flush(ctx)
 
     displayer.close()