From fc6772c5fca00ef13fdf0980c7a8a67a28560c77 Mon Sep 17 00:00:00 2001 From: FUJIWARA Katsunori Date: Wed, 2 Dec 2015 03:12:08 +0900 Subject: [PATCH] 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 --- hgext/shelve.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hgext/shelve.py b/hgext/shelve.py index 610cda7634..f31ba1ac17 100644 --- a/hgext/shelve.py +++ b/hgext/shelve.py @@ -226,6 +226,7 @@ def createcmd(ui, repo, pats, opts): """subcommand that creates a new shelve""" wlock = repo.wlock() try: + cmdutil.checkunfinished(repo) return _docreatecmd(ui, repo, pats, opts) finally: lockmod.release(wlock) @@ -808,8 +809,6 @@ def shelvecmd(ui, repo, *pats, **opts): To delete specific shelved changes, use ``--delete``. To delete all shelved changes, use ``--cleanup``. ''' - cmdutil.checkunfinished(repo) - allowables = [ ('addremove', set(['create'])), # 'create' is pseudo action ('cleanup', set(['cleanup'])),