mirror of
https://github.com/facebook/sapling.git
synced 2024-10-08 15:57:43 +03:00
with: use context manager for wlock in keyword demo
This commit is contained in:
parent
82870250ec
commit
6b60d65449
@ -444,11 +444,8 @@ def demo(ui, repo, *args, **opts):
|
||||
repo[None].add([fn])
|
||||
ui.note(_('\nkeywords written to %s:\n') % fn)
|
||||
ui.note(keywords)
|
||||
wlock = repo.wlock()
|
||||
try:
|
||||
with repo.wlock():
|
||||
repo.dirstate.setbranch('demobranch')
|
||||
finally:
|
||||
wlock.release()
|
||||
for name, cmd in ui.configitems('hooks'):
|
||||
if name.split('.', 1)[0].find('commit') > -1:
|
||||
repo.ui.setconfig('hooks', name, '', 'keyword')
|
||||
|
Loading…
Reference in New Issue
Block a user