changeset 35622:e925f33ac088

share: convert EOL of hgrc before writing to bytes IO Text IO is useless on Python 3 as it must be a unicode stream.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 13 Jan 2018 13:31:27 +0900
parents 38649e2fbf6c
children f56f8abbeaf1
files mercurial/hg.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hg.py	Sat Jan 13 13:28:12 2018 +0900
+++ b/mercurial/hg.py	Sat Jan 13 13:31:27 2018 +0900
@@ -307,9 +307,9 @@
     """
     default = defaultpath or sourcerepo.ui.config('paths', 'default')
     if default:
-        with destrepo.vfs("hgrc", "w", text=True) as fp:
-            fp.write("[paths]\n")
-            fp.write("default = %s\n" % default)
+        template = ('[paths]\n'
+                    'default = %s\n')
+        destrepo.vfs.write('hgrc', util.tonativeeol(template % default))
 
     with destrepo.wlock():
         if bookmarks: