Mercurial > hg
comparison mercurial/context.py @ 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 | 168283c8dedf |
comparison
equal
deleted
inserted
replaced
21473:ef9b2bea9709 | 21474:6d7dcabb843f |
---|---|
1276 for f in removed: | 1276 for f in removed: |
1277 if f in mf: | 1277 if f in mf: |
1278 del mf[f] | 1278 del mf[f] |
1279 return mf | 1279 return mf |
1280 | 1280 |
1281 def _prestatus(self, other, s, match, listignored, listclean, listunknown): | |
1282 """override the parent hook with a dirstate query | |
1283 | |
1284 We use this prestatus hook to populate the status with information from | |
1285 the dirstate. | |
1286 """ | |
1287 return self._dirstatestatus(match, listignored, listclean, listunknown) | |
1288 | |
1281 def _dirstatestatus(self, match=None, ignored=False, clean=False, | 1289 def _dirstatestatus(self, match=None, ignored=False, clean=False, |
1282 unknown=False): | 1290 unknown=False): |
1283 '''Gets the status from the dirstate -- internal use only.''' | 1291 '''Gets the status from the dirstate -- internal use only.''' |
1284 listignored, listclean, listunknown = ignored, clean, unknown | 1292 listignored, listclean, listunknown = ignored, clean, unknown |
1285 match = match or matchmod.always(self._repo.root, self._repo.getcwd()) | 1293 match = match or matchmod.always(self._repo.root, self._repo.getcwd()) |