Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 21845:04f5b5e3792e
committablectx: move __contains__ into workingctx
This was mistakenly moved from workingctx to committablectx in
9d56a3359011. Since the method is querying the dirstate, the only logical place
is for it to reside is in workingctx.
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Thu, 03 Jul 2014 23:01:37 -0500 |
parents | 7cfd94ec5d30 |
children | e6754f5e4cf7 |
comparison
equal
deleted
inserted
replaced
21844:7cfd94ec5d30 | 21845:04f5b5e3792e |
---|---|
974 return str(self._parents[0]) + "+" | 974 return str(self._parents[0]) + "+" |
975 | 975 |
976 def __nonzero__(self): | 976 def __nonzero__(self): |
977 return True | 977 return True |
978 | 978 |
979 def __contains__(self, key): | |
980 return self._repo.dirstate[key] not in "?r" | |
981 | |
982 def _buildflagfunc(self): | 979 def _buildflagfunc(self): |
983 # Create a fallback function for getting file flags when the | 980 # Create a fallback function for getting file flags when the |
984 # filesystem doesn't support them | 981 # filesystem doesn't support them |
985 | 982 |
986 copiesget = self._repo.dirstate.copies().get | 983 copiesget = self._repo.dirstate.copies().get |
1176 def __iter__(self): | 1173 def __iter__(self): |
1177 d = self._repo.dirstate | 1174 d = self._repo.dirstate |
1178 for f in d: | 1175 for f in d: |
1179 if d[f] != 'r': | 1176 if d[f] != 'r': |
1180 yield f | 1177 yield f |
1178 | |
1179 def __contains__(self, key): | |
1180 return self._repo.dirstate[key] not in "?r" | |
1181 | 1181 |
1182 @propertycache | 1182 @propertycache |
1183 def _parents(self): | 1183 def _parents(self): |
1184 p = self._repo.dirstate.parents() | 1184 p = self._repo.dirstate.parents() |
1185 if p[1] == nullid: | 1185 if p[1] == nullid: |