The posixfile implemented using the win32 API should be iterable.
authorChristian Boos <cboos@neuf.fr>
Wed, 10 May 2006 11:53:56 +0200
changeset 2243 caf2c6ef5b0e
parent 2242 78ab05ef1339
child 2244 76be4e66ddc8
child 2246 3fd603eb6add
The posixfile implemented using the win32 API should be iterable.
mercurial/util_win32.py
--- a/mercurial/util_win32.py	Tue May 09 20:56:57 2006 -0700
+++ b/mercurial/util_win32.py	Wed May 10 11:53:56 2006 +0200
@@ -220,6 +220,10 @@
         self.name = name
         self.mode = mode
 
+    def __iter__(self):
+        for line in self.read().splitlines(True):
+            yield line
+
     def read(self, count=-1):
         try:
             cs = cStringIO.StringIO()