mercurial/commands.py
changeset 33687 6294654453ee
parent 33667 03039ff3082b
child 33688 2194a8723138
--- a/mercurial/commands.py	Fri Aug 04 08:15:10 2017 +0200
+++ b/mercurial/commands.py	Thu Aug 03 00:45:02 2017 +0900
@@ -1644,8 +1644,8 @@
                 samplehgrc = uimod.samplehgrcs['user']
 
             f = paths[0]
-            fp = open(f, "w")
-            fp.write(samplehgrc)
+            fp = open(f, "wb")
+            fp.write(util.tonativeeol(samplehgrc))
             fp.close()
 
         editor = ui.geteditor()