cmdutil: add a hook for making custom non-follow log file matchers stable
authorSiddharth Agarwal <sid0@fb.com>
Wed, 13 Aug 2014 15:17:03 -0700
branchstable
changeset 22167 d4bc38f6eab7
parent 22166 ac7a3b2a85e3
child 22168 1b9d0dc1bbe1
cmdutil: add a hook for making custom non-follow log file matchers This will be used by largefiles (and basically only by largefiles) in an upcoming patch.
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Wed Aug 13 15:15:13 2014 -0700
+++ b/mercurial/cmdutil.py	Wed Aug 13 15:17:03 2014 -0700
@@ -1519,6 +1519,10 @@
 
     return filematcher
 
+def _makenofollowlogfilematcher(repo, pats, opts):
+    '''hook for extensions to override the filematcher for non-follow cases'''
+    return None
+
 def _makelogrevset(repo, pats, opts, revs):
     """Return (expr, filematcher) where expr is a revset string built
     from log options and file patterns or None. If --stat or --patch
@@ -1635,7 +1639,9 @@
             filematcher = _makefollowlogfilematcher(repo, match.files(),
                                                     followfirst)
         else:
-            filematcher = lambda rev: match
+            filematcher = _makenofollowlogfilematcher(repo, pats, opts)
+            if filematcher is None:
+                filematcher = lambda rev: match
 
     expr = []
     for op, val in opts.iteritems():