Mercurial > public > mercurial-scm > hg-stable
diff mercurial/patch.py @ 36845:472c68cda3f8
py3: wrap file object to write patch in native eol preserving byte-ness
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Tue, 06 Mar 2018 07:45:57 -0600 |
parents | 5bc7ff103081 |
children | c268ba15deb3 |
line wrap: on
line diff
--- a/mercurial/patch.py Tue Mar 06 07:24:12 2018 -0600 +++ b/mercurial/patch.py Tue Mar 06 07:45:57 2018 -0600 @@ -1102,11 +1102,11 @@ the hunk is left unchanged. """) (patchfd, patchfn) = tempfile.mkstemp(prefix="hg-editor-", - suffix=".diff", text=True) + suffix=".diff") ncpatchfp = None try: # Write the initial patch - f = os.fdopen(patchfd, r"w") + f = util.nativeeolwriter(os.fdopen(patchfd, r'wb')) chunk.header.write(f) chunk.write(f) f.write('\n'.join(['# ' + i for i in phelp.splitlines()]))