mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
shelve: execute checkunfinished inside wlock scope
Before this patch, "hg shelve" of shelve extension executes 'cmdutil.checkunfinished()' before acquisition of wlock. It may cause unintentional result, if another command runs parallelly (see also issue4368). To avoid this issue, this patch executes 'cmdutil.checkunfinished()' inside wlock scope of "hg shelve". This also fixes issue4957, because now 'cmdutil.checkunfinished()' isn't invoked at "hg shelve" with options below: --cleanup --delete --list --patch --stat
This commit is contained in:
parent
157a86fc91
commit
fc6772c5fc
@ -226,6 +226,7 @@ def createcmd(ui, repo, pats, opts):
|
|||||||
"""subcommand that creates a new shelve"""
|
"""subcommand that creates a new shelve"""
|
||||||
wlock = repo.wlock()
|
wlock = repo.wlock()
|
||||||
try:
|
try:
|
||||||
|
cmdutil.checkunfinished(repo)
|
||||||
return _docreatecmd(ui, repo, pats, opts)
|
return _docreatecmd(ui, repo, pats, opts)
|
||||||
finally:
|
finally:
|
||||||
lockmod.release(wlock)
|
lockmod.release(wlock)
|
||||||
@ -808,8 +809,6 @@ def shelvecmd(ui, repo, *pats, **opts):
|
|||||||
To delete specific shelved changes, use ``--delete``. To delete
|
To delete specific shelved changes, use ``--delete``. To delete
|
||||||
all shelved changes, use ``--cleanup``.
|
all shelved changes, use ``--cleanup``.
|
||||||
'''
|
'''
|
||||||
cmdutil.checkunfinished(repo)
|
|
||||||
|
|
||||||
allowables = [
|
allowables = [
|
||||||
('addremove', set(['create'])), # 'create' is pseudo action
|
('addremove', set(['create'])), # 'create' is pseudo action
|
||||||
('cleanup', set(['cleanup'])),
|
('cleanup', set(['cleanup'])),
|
||||||
|
Loading…
Reference in New Issue
Block a user