shelve: move createcmd next to _docreatecmd
It is simpler not to have to jump around the file all the time.
--- 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()