##// 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 backupfile = repo.join(state.backupfile)
1066 backupfile = repo.join(state.backupfile)
1067 f = hg.openpath(ui, backupfile)
1067 f = hg.openpath(ui, backupfile)
1068 gen = exchange.readbundle(ui, f, backupfile)
1068 gen = exchange.readbundle(ui, f, backupfile)
1069 tr = repo.transaction('histedit.abort')
1069 with repo.transaction('histedit.abort') as tr:
1070 try:
1071 if not isinstance(gen, bundle2.unbundle20):
1070 if not isinstance(gen, bundle2.unbundle20):
1072 gen.apply(repo, 'histedit', 'bundle:' + backupfile)
1071 gen.apply(repo, 'histedit', 'bundle:' + backupfile)
1073 if isinstance(gen, bundle2.unbundle20):
1072 if isinstance(gen, bundle2.unbundle20):
1074 bundle2.applybundle(repo, gen, tr,
1073 bundle2.applybundle(repo, gen, tr,
1075 source='histedit',
1074 source='histedit',
1076 url='bundle:' + backupfile)
1075 url='bundle:' + backupfile)
1077 tr.close()
1078 finally:
1079 tr.release()
1080
1076
1081 os.remove(backupfile)
1077 os.remove(backupfile)
1082
1078
General Comments 0
You need to be logged in to leave comments. Login now