Mercurial > hg
comparison mercurial/context.py @ 14129:81e6d42b3228
context: provide an efficient iterator for workingctx
This avoids needing to call status or build a synthetic manifest.
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 01 May 2011 08:29:50 -0500 |
parents | 97ed99d1f419 |
children | 137b03b5aea1 |
comparison
equal
deleted
inserted
replaced
14128:0386b51dd749 | 14129:81e6d42b3228 |
---|---|
658 for f in deleted + removed: | 658 for f in deleted + removed: |
659 if f in man: | 659 if f in man: |
660 del man[f] | 660 del man[f] |
661 | 661 |
662 return man | 662 return man |
663 | |
664 def __iter__(self): | |
665 d = self._repo.dirstate | |
666 for f in d: | |
667 if d[f] != 'r': | |
668 yield f | |
663 | 669 |
664 @propertycache | 670 @propertycache |
665 def _status(self): | 671 def _status(self): |
666 return self._repo.status()[:4] | 672 return self._repo.status()[:4] |
667 | 673 |