##// END OF EJS Templates
with: use context manager for wlock in sign
Bryan O'Sullivan -
r27814:a7273502 default
parent child Browse files
Show More
@@ -9,7 +9,6 b' import os, tempfile, binascii'
9 from mercurial import util, commands, match, cmdutil, error
9 from mercurial import util, commands, match, cmdutil, error
10 from mercurial import node as hgnode
10 from mercurial import node as hgnode
11 from mercurial.i18n import _
11 from mercurial.i18n import _
12 from mercurial import lock as lockmod
13
12
14 cmdtable = {}
13 cmdtable = {}
15 command = cmdutil.command(cmdtable)
14 command = cmdutil.command(cmdtable)
@@ -223,12 +222,8 b' def sign(ui, repo, *revs, **opts):'
223
222
224 See :hg:`help dates` for a list of formats valid for -d/--date.
223 See :hg:`help dates` for a list of formats valid for -d/--date.
225 """
224 """
226 wlock = None
225 with repo.wlock():
227 try:
228 wlock = repo.wlock()
229 return _dosign(ui, repo, *revs, **opts)
226 return _dosign(ui, repo, *revs, **opts)
230 finally:
231 lockmod.release(wlock)
232
227
233 def _dosign(ui, repo, *revs, **opts):
228 def _dosign(ui, repo, *revs, **opts):
234 mygpg = newgpg(ui, **opts)
229 mygpg = newgpg(ui, **opts)
General Comments 0
You need to be logged in to leave comments. Login now