comparison hgext/histedit.py @ 36168:be73fa5b42d3

histedit: modernize write of histedit-last-edit file Differential Revision: https://phab.mercurial-scm.org/D2241
author Augie Fackler <augie@google.com>
date Tue, 13 Feb 2018 17:25:43 -0500
parents 73621823a1ac
children 28830ba50687
comparison
equal deleted inserted replaced
36167:73621823a1ac 36168:be73fa5b42d3
1413 repopath=repo.path, action='histedit') 1413 repopath=repo.path, action='histedit')
1414 1414
1415 # Save edit rules in .hg/histedit-last-edit.txt in case 1415 # Save edit rules in .hg/histedit-last-edit.txt in case
1416 # the user needs to ask for help after something 1416 # the user needs to ask for help after something
1417 # surprising happens. 1417 # surprising happens.
1418 f = open(repo.vfs.join('histedit-last-edit.txt'), 'w') 1418 with repo.vfs('histedit-last-edit.txt', 'wb') as f:
1419 f.write(rules) 1419 f.write(rules)
1420 f.close()
1421 1420
1422 return rules 1421 return rules
1423 1422
1424 def parserules(rules, state): 1423 def parserules(rules, state):
1425 """Read the histedit rules string and return list of action objects """ 1424 """Read the histedit rules string and return list of action objects """