# HG changeset patch # User FUJIWARA Katsunori # Date 1448993528 -32400 # Node ID 7df042d0784fe93017c766f76625ce8f77a8a6bc # Parent 6df3ec5bb813f5ec7bb80d2448606a6855c65b9e 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 diff -r 6df3ec5bb813 -r 7df042d0784f hgext/shelve.py --- a/hgext/shelve.py Wed Dec 02 03:12:08 2015 +0900 +++ b/hgext/shelve.py Wed Dec 02 03:12:08 2015 +0900 @@ -226,6 +226,7 @@ """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 @@ 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'])),