inhibit: fix devel warning
_inhibitmarkers was taking a transaction without the proper lock. Adding the
lock removes the warnings.
--- 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