workingctx: add _prestatus method to call _dirstatestatus
authorSean Farley <sean.michael.farley@gmail.com>
Mon, 21 Apr 2014 22:12:59 -0500
changeset 21474 6d7dcabb843f
parent 21473 ef9b2bea9709
child 21475 c6976a4a39db
workingctx: add _prestatus method to call _dirstatestatus With this patch, we are one step closer to removing 'if ... else' logic in localrepo.status for testing if the context is the working directory or not. Future patches will replace those blocks of code with a call to the context's _prestatus hook so that each context object will do the right thing depending on the situation.
mercurial/context.py
--- a/mercurial/context.py	Mon Apr 21 21:39:10 2014 -0500
+++ b/mercurial/context.py	Mon Apr 21 22:12:59 2014 -0500
@@ -1278,6 +1278,14 @@
                 del mf[f]
         return mf
 
+    def _prestatus(self, other, s, match, listignored, listclean, listunknown):
+        """override the parent hook with a dirstate query
+
+        We use this prestatus hook to populate the status with information from
+        the dirstate.
+        """
+        return self._dirstatestatus(match, listignored, listclean, listunknown)
+
     def _dirstatestatus(self, match=None, ignored=False, clean=False,
                         unknown=False):
         '''Gets the status from the dirstate -- internal use only.'''