Mercurial > hg
changeset 97:7a2abee6b0c2
Add iterator to the lazymap code
author | mpm@selenic.com |
---|---|
date | Wed, 18 May 2005 16:47:49 -0800 |
parents | fce47326677c |
children | 3dde7c87e36d |
files | mercurial/revlog.py |
diffstat | 1 files changed, 7 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revlog.py Wed May 18 16:45:44 2005 -0800 +++ b/mercurial/revlog.py Wed May 18 16:47:49 2005 -0800 @@ -87,6 +87,13 @@ return True except KeyError: return False + def __iter__(self): + for i in xrange(self.p.l): + try: + yield self.p.index[i][6] + except: + self.p.load(i) + yield self.p.index[i][6] def __getitem__(self, key): try: return self.p.map[key]