##// END OF EJS Templates
with: use context manager in _histedit
Bryan O'Sullivan -
r27869:76ecf022 default
parent child Browse files
Show More
@@ -1066,17 +1066,13 b' def _histedit(ui, repo, state, *freeargs'
1066 1066 backupfile = repo.join(state.backupfile)
1067 1067 f = hg.openpath(ui, backupfile)
1068 1068 gen = exchange.readbundle(ui, f, backupfile)
1069 tr = repo.transaction('histedit.abort')
1070 try:
1069 with repo.transaction('histedit.abort') as tr:
1071 1070 if not isinstance(gen, bundle2.unbundle20):
1072 1071 gen.apply(repo, 'histedit', 'bundle:' + backupfile)
1073 1072 if isinstance(gen, bundle2.unbundle20):
1074 1073 bundle2.applybundle(repo, gen, tr,
1075 1074 source='histedit',
1076 1075 url='bundle:' + backupfile)
1077 tr.close()
1078 finally:
1079 tr.release()
1080 1076
1081 1077 os.remove(backupfile)
1082 1078
General Comments 0
You need to be logged in to leave comments. Login now