# HG changeset patch # User Bryan O'Sullivan # Date 1452892489 28800 # Node ID 0da102e4f203e68c2c88369feebdb04064e5bed6 # Parent f55a5ace8e69bd56bcf3e454745c857c8fea7b7c with: use context manager in rebuildfncache again diff -r f55a5ace8e69 -r 0da102e4f203 mercurial/repair.py --- a/mercurial/repair.py Fri Jan 15 13:14:49 2016 -0800 +++ b/mercurial/repair.py Fri Jan 15 13:14:49 2016 -0800 @@ -252,8 +252,7 @@ 'support fncache)\n')) return - lock = repo.lock() - try: + with repo.lock(): fnc = repo.store.fncache # Trigger load of fncache. if 'irrelevant' in fnc: @@ -305,8 +304,6 @@ tr.release() else: ui.write(_('fncache already up to date\n')) - finally: - lock.release() def stripbmrevset(repo, mark): """