# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1398285570 18000
#      Wed Apr 23 15:39:30 2014 -0500
# Node ID 2f1567ef70ba258f416d167f0dc48d0de737dd21
# Parent  d19f491e5d5b19d0bc3ee81cb8b9df09c772a1b2
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.

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -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