Patchwork D2241: histedit: modernize write of histedit-last-edit file

login
register
mail settings
Submitter phabricator
Date Feb. 14, 2018, 5:06 a.m.
Message ID <9d0d78b5e96d3e718c85433e85688080@localhost.localdomain>
Download mbox | patch
Permalink /patch/27872/
State Not Applicable
Headers show

Comments

phabricator - Feb. 14, 2018, 5:06 a.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGbe73fa5b42d3: histedit: modernize write of histedit-last-edit file (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2241?vs=5663&id=5677

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

AFFECTED FILES
  hgext/histedit.py

CHANGE DETAILS




To: 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
@@ -1415,9 +1415,8 @@ 
     # Save edit rules in .hg/histedit-last-edit.txt in case
     # the user needs to ask for help after something
     # surprising happens.
-    f = open(repo.vfs.join('histedit-last-edit.txt'), 'w')
-    f.write(rules)
-    f.close()
+    with repo.vfs('histedit-last-edit.txt', 'wb') as f:
+        f.write(rules)
 
     return rules