changeset 21474:6d7dcabb843f

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.
author Sean Farley <sean.michael.farley@gmail.com>
date Mon, 21 Apr 2014 22:12:59 -0500
parents ef9b2bea9709
children c6976a4a39db
files mercurial/context.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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.'''