diff 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 (2011-05-01)
parents 97ed99d1f419
children 137b03b5aea1
line wrap: on
line diff
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -661,6 +661,12 @@
 
         return man
 
+    def __iter__(self):
+        d = self._repo.dirstate
+        for f in d:
+            if d[f] != 'r':
+                yield f
+
     @propertycache
     def _status(self):
         return self._repo.status()[:4]