# HG changeset patch # User Sean Farley # Date 1398136379 18000 # Node ID 6d7dcabb843fbe7fc03b3f17ba2eb32c1f0cd2f6 # Parent ef9b2bea970924bbfdb253c8bbd708feb26c617d 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. diff -r ef9b2bea9709 -r 6d7dcabb843f 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.'''