Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 19552:6b76070c4b54
basectx: move __iter__ from changectx
author | Sean Farley <sean.michael.farley@gmail.com> |
---|---|
date | Mon, 05 Aug 2013 17:22:18 -0500 |
parents | e07c69145724 |
children | 64a99d972b9e |
comparison
equal
deleted
inserted
replaced
19551:e07c69145724 | 19552:6b76070c4b54 |
---|---|
56 def __contains__(self, key): | 56 def __contains__(self, key): |
57 return key in self._manifest | 57 return key in self._manifest |
58 | 58 |
59 def __getitem__(self, key): | 59 def __getitem__(self, key): |
60 return self.filectx(key) | 60 return self.filectx(key) |
61 | |
62 def __iter__(self): | |
63 for f in sorted(self._manifest): | |
64 yield f | |
61 | 65 |
62 @propertycache | 66 @propertycache |
63 def substate(self): | 67 def substate(self): |
64 return subrepo.state(self, self._repo.ui) | 68 return subrepo.state(self, self._repo.ui) |
65 | 69 |
200 def _parents(self): | 204 def _parents(self): |
201 p = self._repo.changelog.parentrevs(self._rev) | 205 p = self._repo.changelog.parentrevs(self._rev) |
202 if p[1] == nullrev: | 206 if p[1] == nullrev: |
203 p = p[:-1] | 207 p = p[:-1] |
204 return [changectx(self._repo, x) for x in p] | 208 return [changectx(self._repo, x) for x in p] |
205 | |
206 def __iter__(self): | |
207 for f in sorted(self._manifest): | |
208 yield f | |
209 | 209 |
210 def changeset(self): | 210 def changeset(self): |
211 return self._changeset | 211 return self._changeset |
212 def manifest(self): | 212 def manifest(self): |
213 return self._manifest | 213 return self._manifest |