##// END OF EJS Templates
with: use context manager for wlock in transplant
Bryan O'Sullivan -
r27840:dc237afa default
parent child Browse files
Show More
@@ -20,7 +20,6 b' from mercurial.node import short'
20 from mercurial import bundlerepo, hg, merge, match
20 from mercurial import bundlerepo, hg, merge, match
21 from mercurial import patch, revlog, scmutil, util, error, cmdutil
21 from mercurial import patch, revlog, scmutil, util, error, cmdutil
22 from mercurial import revset, templatekw, exchange
22 from mercurial import revset, templatekw, exchange
23 from mercurial import lock as lockmod
24
23
25 class TransplantError(error.Abort):
24 class TransplantError(error.Abort):
26 pass
25 pass
@@ -575,12 +574,8 b' def transplant(ui, repo, *revs, **opts):'
575 and then resume where you left off by calling :hg:`transplant
574 and then resume where you left off by calling :hg:`transplant
576 --continue/-c`.
575 --continue/-c`.
577 '''
576 '''
578 wlock = None
577 with repo.wlock():
579 try:
580 wlock = repo.wlock()
581 return _dotransplant(ui, repo, *revs, **opts)
578 return _dotransplant(ui, repo, *revs, **opts)
582 finally:
583 lockmod.release(wlock)
584
579
585 def _dotransplant(ui, repo, *revs, **opts):
580 def _dotransplant(ui, repo, *revs, **opts):
586 def incwalk(repo, csets, match=util.always):
581 def incwalk(repo, csets, match=util.always):
General Comments 0
You need to be logged in to leave comments. Login now