mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 07:49:11 +03:00
with: use context manager for wlock in qnew
This commit is contained in:
parent
e41ff99cd6
commit
68786b4a3e
@ -1168,8 +1168,7 @@ class queue(object):
|
||||
raise error.Abort(_('cannot manage merge changesets'))
|
||||
self.checktoppatch(repo)
|
||||
insert = self.fullseriesend()
|
||||
wlock = repo.wlock()
|
||||
try:
|
||||
with repo.wlock():
|
||||
try:
|
||||
# if patch file write fails, abort early
|
||||
p = self.opener(patchfn, "w")
|
||||
@ -1239,8 +1238,6 @@ class queue(object):
|
||||
self.ui.warn(_('error unlinking %s\n') % patchpath)
|
||||
raise
|
||||
self.removeundo(repo)
|
||||
finally:
|
||||
release(wlock)
|
||||
|
||||
def isapplied(self, patch):
|
||||
"""returns (index, rev, patch)"""
|
||||
|
Loading…
Reference in New Issue
Block a user