# HG changeset patch # User Laurent Charignon # Date 1430337683 25200 # Node ID 51ec3610968cd31be655453bd45bfacbe3d48530 # Parent 1ac05eef72caaf956e671019977ddb30e87dbd01 inhibit: fix devel warning _inhibitmarkers was taking a transaction without the proper lock. Adding the lock removes the warnings. diff -r 1ac05eef72ca -r 51ec3610968c hgext/inhibit.py --- a/hgext/inhibit.py Wed Apr 29 14:23:09 2015 -0700 +++ b/hgext/inhibit.py Wed Apr 29 13:01:23 2015 -0700 @@ -29,6 +29,7 @@ from mercurial import revset from mercurial import error from mercurial import commands +from mercurial import lock as lockmod from mercurial import bookmarks from mercurial.i18n import _ @@ -126,14 +127,16 @@ """ newinhibit = repo.set('::%ln and obsolete()', nodes) if newinhibit: - tr = repo.transaction('obsinhibit') + lock = tr = None try: + lock = repo.lock() + tr = repo.transaction('obsinhibit') repo._obsinhibit.update(c.node() for c in newinhibit) _schedulewrite(tr, _filterpublic(repo, repo._obsinhibit)) repo.invalidatevolatilesets() tr.close() finally: - tr.release() + lockmod.release(tr, lock) def _deinhibitmarkers(repo, nodes): """lift obsolescence inhibition on a set of nodes