# HG changeset patch # User Sean Farley # Date 2014-04-22 17:59:22 # Node ID 466964bdf4c1acadf6effda007b0c54b2983ed40 # Parent 168283c8dedff0c6536bb2197b053941a463870a workingctx: add _poststatus method to call _filtersuspectsymlink 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 _poststatus hook so that each context object will do the right thing depending on the situation. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -1294,6 +1294,16 @@ class workingctx(committablectx): """ return self._dirstatestatus(match, listignored, listclean, listunknown) + def _poststatus(self, other, s, match, listignored, listclean, listunknown): + """override the parent hook with a filter for suspect symlinks + + We use this poststatus hook to filter out symlinks that might have + accidentally ended up with the entire contents of the file they are + susposed to be linking to. + """ + s[0] = self._filtersuspectsymlink(s[0]) + return s + def _dirstatestatus(self, match=None, ignored=False, clean=False, unknown=False): '''Gets the status from the dirstate -- internal use only.'''