shelve: move createcmd next to _docreatecmd
authorBoris Feld <boris.feld@octobus.net>
Thu, 23 Aug 2018 00:51:38 +0200
changeset 39342 d52fa7ddd1ac
parent 39341 ca2f4dabf51d
child 39343 bab58b1d87c7
shelve: move createcmd next to _docreatecmd It is simpler not to have to jump around the file all the time.
hgext/shelve.py
--- a/hgext/shelve.py	Sun Aug 05 13:34:04 2018 +0900
+++ b/hgext/shelve.py	Thu Aug 23 00:51:38 2018 +0200
@@ -323,12 +323,6 @@
     narrowspec.restorebackup(repo, narrowspecbackupname)
     repo.dirstate.restorebackup(None, dirstatebackupname)
 
-def createcmd(ui, repo, pats, opts):
-    """subcommand that creates a new shelve"""
-    with repo.wlock():
-        cmdutil.checkunfinished(repo)
-        return _docreatecmd(ui, repo, pats, opts)
-
 def getshelvename(repo, parent, opts):
     """Decide on the name this shelve is going to have"""
     def gennames():
@@ -430,6 +424,12 @@
 def _finishshelve(repo):
     _aborttransaction(repo)
 
+def createcmd(ui, repo, pats, opts):
+    """subcommand that creates a new shelve"""
+    with repo.wlock():
+        cmdutil.checkunfinished(repo)
+        return _docreatecmd(ui, repo, pats, opts)
+
 def _docreatecmd(ui, repo, pats, opts):
     wctx = repo[None]
     parents = wctx.parents()