obsolete: use context manager for transaction in createmarkers()
Differential Revision: https://phab.mercurial-scm.org/D1835
--- a/mercurial/obsolete.py Fri Jan 05 09:12:08 2018 +0100
+++ b/mercurial/obsolete.py Wed Jan 10 10:30:51 2018 -0800
@@ -1081,8 +1081,7 @@
saveeffectflag = repo.ui.configbool('experimental',
'evolution.effect-flags')
- tr = repo.transaction('add-obsolescence-marker')
- try:
+ with repo.transaction('add-obsolescence-marker') as tr:
markerargs = []
for rel in relations:
prec = rel[0]
@@ -1123,6 +1122,3 @@
date=date, metadata=localmetadata,
ui=repo.ui)
repo.filteredrevcache.clear()
- tr.close()
- finally:
- tr.release()