changeset 43372:66a0c5faed1e stable

py3: open chistedit file in binary mode using vfs We write bytes to the file, so it should be open in binary mode. Opening it via the vfs takes care of that for us. Now you'll get yet a different traceback if you try to confirm you histedit plan. Differential Revision: https://phab.mercurial-scm.org/D7185
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 31 Oct 2019 15:00:49 -0700
parents 85ab79bc7dab
children de2c8722a787
files hgext/histedit.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/histedit.py	Thu Oct 31 15:02:48 2019 -0700
+++ b/hgext/histedit.py	Thu Oct 31 15:00:49 2019 -0700
@@ -1684,11 +1684,10 @@
         if type(rc) is list:
             ui.status(_(b"performing changes\n"))
             rules = makecommands(rc)
-            filename = repo.vfs.join(b'chistedit')
-            with open(filename, b'w+') as fp:
+            with repo.vfs(b'chistedit', b'w+') as fp:
                 for r in rules:
                     fp.write(r)
-            opts[b'commands'] = filename
+                opts[b'commands'] = fp.name
             return _texthistedit(ui, repo, *freeargs, **opts)
     except KeyboardInterrupt:
         pass