changeset 27288:c14af2d4b08c

shelve: remove redundant acquisition of wlock for sub commands of unshelve Previous patch ensures that wlock is acquired before processing for "hg unshelve". It makes acquisition of wlock in each functions below redundant. - unshelveabort() for "unshelve --abort" - unshelvecontinue() for "unshelve --continue"
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Wed, 09 Dec 2015 08:28:53 +0900
parents c9ceea3f2d8e
children ee33e677f0ac
files hgext/shelve.py
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/shelve.py	Wed Dec 09 08:28:53 2015 +0900
+++ b/hgext/shelve.py	Wed Dec 09 08:28:53 2015 +0900
@@ -473,7 +473,6 @@
 
 def unshelveabort(ui, repo, state, opts):
     """subcommand that abort an in-progress unshelve"""
-    wlock = repo.wlock()
     lock = None
     try:
         checkparents(repo, state)
@@ -497,7 +496,7 @@
     finally:
         shelvedstate.clear(repo)
         ui.warn(_("unshelve of '%s' aborted\n") % state.name)
-        lockmod.release(lock, wlock)
+        lockmod.release(lock)
 
 def mergefiles(ui, repo, wctx, shelvectx):
     """updates to wctx and merges the changes from shelvectx into the
@@ -533,7 +532,6 @@
     """subcommand to continue an in-progress unshelve"""
     # We're finishing off a merge. First parent is our original
     # parent, second is the temporary "fake" commit we're unshelving.
-    wlock = repo.wlock()
     lock = None
     try:
         checkparents(repo, state)
@@ -571,7 +569,7 @@
         unshelvecleanup(ui, repo, state.name, opts)
         ui.status(_("unshelve of '%s' complete\n") % state.name)
     finally:
-        lockmod.release(lock, wlock)
+        lockmod.release(lock)
 
 @command('unshelve',
          [('a', 'abort', None,