[patch] small fix for 'hg tags' on windows

Christian Boos cboos at neuf.fr
Wed May 10 04:50:56 CDT 2006


Benoit Boissinot wrote:
> On 5/10/06, Christian Boos <cboos at neuf.fr> wrote:
>> +    def __iter__(self):
>> +        for line in self.read().split('\n'):
>
> split will remove the '\n' from the line,
> self.read().splitlines(True) should be used instead
>
> Can you fix it and resend it ?

Sure, here it is.

-- Christian

-------------- next part --------------
# HG changeset patch
# User Christian Boos <cboos at neuf.fr>
# Node ID 8748e2de06ab6ddd628274299b4bdc4cf08d4db4
# Parent  8b106ff5b8a980b1d76a8ee66461a4b6a35243a0
The posixfile implemented using the win32 API should be iterable.

diff -r 8b106ff5b8a9 -r 8748e2de06ab mercurial/util_win32.py
--- a/mercurial/util_win32.py	Mon May 08 14:20:37 2006 -0700
+++ b/mercurial/util_win32.py	Wed May 10 11:28:28 2006 +0200
@@ -220,6 +220,10 @@ class posixfile(object):
         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()


More information about the Mercurial mailing list