diff hgext/convert/convcmd.py @ 36148:0f9e52f900c4

convert: fix line ending of mapfile and commit.desc file Follows up 42a393ea56d2. CRLF vs LF doesn't really matter as we do strip() or rstrip() on read, but mixing them isn't nice. So let's restore the old behavior. I don't know whether CVS/Root, CVS/Repository, and ~/.cvspass are written in native line ending, so I leave them read as binary files.
author Yuya Nishihara <yuya@tcha.org>
date Tue, 13 Feb 2018 21:52:51 +0900
parents 6df206ef4b10
children 93943eef696f
line wrap: on
line diff
--- a/hgext/convert/convcmd.py	Sun Feb 11 18:34:22 2018 -0800
+++ b/hgext/convert/convcmd.py	Tue Feb 13 21:52:51 2018 +0900
@@ -411,7 +411,8 @@
             self.ui.status(_('writing author map file %s\n') % authorfile)
             ofile = open(authorfile, 'wb+')
             for author in self.authors:
-                ofile.write("%s=%s\n" % (author, self.authors[author]))
+                ofile.write(util.tonativeeol("%s=%s\n"
+                                             % (author, self.authors[author])))
             ofile.close()
 
     def readauthormap(self, authorfile):