histedit: modernize write of histedit-last-edit file
Differential Revision: https://phab.mercurial-scm.org/D2241
--- a/hgext/histedit.py Tue Feb 13 17:25:25 2018 -0500
+++ b/hgext/histedit.py Tue Feb 13 17:25:43 2018 -0500
@@ -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