# HG changeset patch # User Yuya Nishihara <y...@tcha.org> # Date 1515817692 -32400 # Sat Jan 13 13:28:12 2018 +0900 # Node ID 41f5fc043698f6c8ff042ebb7d380f76a68a006b # Parent f5558d75ef44a2db64131b4e5bca98102542f13b subrepo: convert EOL of hgrc before writing to bytes IO
Follows up f2f0a777b2e2. Text IO is useless on Python 3 as it must be a unicode stream. diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py --- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -841,11 +841,7 @@ class hgsubrepo(abstractsubrepo): if defpath != defpushpath: addpathconfig('default-push', defpushpath) - fp = self._repo.vfs("hgrc", "wb", text=True) - try: - fp.write(''.join(lines)) - finally: - fp.close() + self._repo.vfs.write('hgrc', util.tonativeeol(''.join(lines))) @annotatesubrepoerror def add(self, ui, match, prefix, explicitonly, **opts): _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel