--- a/hgext/gpg.py Fri Jan 15 13:14:46 2016 -0800
+++ b/hgext/gpg.py Fri Jan 15 13:14:46 2016 -0800
@@ -9,7 +9,6 @@
from mercurial import util, commands, match, cmdutil, error
from mercurial import node as hgnode
from mercurial.i18n import _
-from mercurial import lock as lockmod
cmdtable = {}
command = cmdutil.command(cmdtable)
@@ -223,12 +222,8 @@
See :hg:`help dates` for a list of formats valid for -d/--date.
"""
- wlock = None
- try:
- wlock = repo.wlock()
+ with repo.wlock():
return _dosign(ui, repo, *revs, **opts)
- finally:
- lockmod.release(wlock)
def _dosign(ui, repo, *revs, **opts):
mygpg = newgpg(ui, **opts)