merge: replace readline() call, missing from posixfile_nt
authorPatrick Mezard <pmezard@gmail.com>
Sat, 12 Apr 2008 20:51:26 +0200
changeset 6530 4b92591c69a7
parent 6529 0c611355481b
child 6531 c2c4fa9af016
merge: replace readline() call, missing from posixfile_nt
mercurial/merge.py
--- a/mercurial/merge.py	Sat Apr 12 21:34:01 2008 +0200
+++ b/mercurial/merge.py	Sat Apr 12 20:51:26 2008 +0200
@@ -21,11 +21,15 @@
     def _read(self):
         self._state = {}
         try:
+            localnode = None
             f = self._repo.opener("merge/state")
-            self._local = bin(f.readline()[:-1])
-            for l in f:
-                bits = l[:-1].split("\0")
-                self._state[bits[0]] = bits[1:]
+            for i, l in enumerate(f):
+                if i == 0:
+                    localnode = l[:-1]
+                else:
+                    bits = l[:-1].split("\0")
+                    self._state[bits[0]] = bits[1:]
+            self._local = bin(localnode)
         except IOError, err:
             if err.errno != errno.ENOENT:
                 raise