D2501: py3: make sure we write in mergestate in bytes mode

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Thu Mar 1 09:35:53 UTC 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG4af56aaccba4: py3: make sure we write in mergestate in bytes mode (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2501?vs=6201&id=6233

REVISION DETAIL
  https://phab.mercurial-scm.org/D2501

AFFECTED FILES
  mercurial/merge.py

CHANGE DETAILS

diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -399,7 +399,7 @@
 
     def _writerecordsv1(self, records):
         """Write current state on disk in a version 1 file"""
-        f = self._repo.vfs(self.statepathv1, 'w')
+        f = self._repo.vfs(self.statepathv1, 'wb')
         irecords = iter(records)
         lrecords = next(irecords)
         assert lrecords[0] == 'L'
@@ -415,7 +415,7 @@
         See the docstring for _readrecordsv2 for why we use 't'."""
         # these are the records that all version 2 clients can read
         whitelist = 'LOF'
-        f = self._repo.vfs(self.statepathv2, 'w')
+        f = self._repo.vfs(self.statepathv2, 'wb')
         for key, data in records:
             assert len(key) == 1
             if key not in whitelist:



To: pulkit, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list