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.
--- 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.'''