diff mercurial/match.py @ 16645:9a21fc2c7d32

localrepo: optimize internode status calls using match.always Introduce match.always() to check if a match object always says yes, i.e. None was passed in. If so, mfmatches should not bother iterating every file in the repository.
author Jesse Glick <jesse.glick@oracle.com>
date Fri, 04 May 2012 15:54:55 -0400
parents bd12ef347680
children e34106fa0dc3
line wrap: on
line diff
--- a/mercurial/match.py	Fri May 11 23:11:43 2012 +0200
+++ b/mercurial/match.py	Fri May 04 15:54:55 2012 -0400
@@ -118,6 +118,8 @@
         return self._files
     def anypats(self):
         return self._anypats
+    def always(self):
+        return False
 
 class exact(match):
     def __init__(self, root, cwd, files):
@@ -126,6 +128,8 @@
 class always(match):
     def __init__(self, root, cwd):
         match.__init__(self, root, cwd, [])
+    def always(self):
+        return True
 
 class narrowmatcher(match):
     """Adapt a matcher to work on a subdirectory only.