Patchwork D7185: py3: open chistedit file in binary mode using vfs

login
register
mail settings
Submitter phabricator
Date Nov. 1, 2019, 4:17 a.m.
Message ID <3d75475c323e95af4dddc6eff3f2b3f7@localhost.localdomain>
Download mbox | patch
Permalink /patch/42635/
State Not Applicable
Headers show

Comments

phabricator - Nov. 1, 2019, 4:17 a.m.
martinvonz updated this revision to Diff 17432.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7185?vs=17424&id=17432

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7185/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7185

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS




To: martinvonz, durin42, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1677,11 +1677,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