basectx: add _matchstatus method for factoring out last of parentworking logic
authorSean Farley <sean.michael.farley@gmail.com>
Wed, 23 Apr 2014 15:39:30 -0500
changeset 21481 2f1567ef70ba
parent 21480 d19f491e5d5b
child 21482 869a28d016e9
basectx: add _matchstatus method for factoring out last of parentworking logic This patch paves the way to allow a workingctx to override the match object with a custom 'bad' method for cases where status is sent a directory pattern.
mercurial/context.py
--- a/mercurial/context.py	Thu Apr 24 08:34:44 2014 -0500
+++ b/mercurial/context.py	Wed Apr 23 15:39:30 2014 -0500
@@ -78,6 +78,15 @@
                 del mf[fn]
         return mf
 
+    def _matchstatus(self, other, s, match, listignored, listclean,
+                     listunknown):
+        """return match.always if match is none
+
+        This internal method provides a way for child objects to override the
+        match operator.
+        """
+        return match or matchmod.always(self._repo.root, self._repo.getcwd())
+
     def _prestatus(self, other, s, match, listignored, listclean, listunknown):
         """provide a hook to allow child objects to preprocess status results