[PATCH 01 of 10] shelve: move createcmd next to _docreatecmd

Boris Feld boris.feld at octobus.net
Wed Aug 29 16:30:49 UTC 2018


# HG changeset patch
# User Boris Feld <boris.feld at octobus.net>
# Date 1534978298 -7200
#      Thu Aug 23 00:51:38 2018 +0200
# Node ID 2127e141f56510b109f915c2fd5eaf3b205ce037
# Parent  7775c1fb8fa0d67f16d4b3c89ce3aacd35074506
# EXP-Topic internal-phase.shelve
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 2127e141f565
shelve: move createcmd next to _docreatecmd

It is simpler not to have to jump around the file all the time.

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -323,12 +323,6 @@ def _aborttransaction(repo):
     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 _includeunknownfiles(repo, pats, opt
 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()


More information about the Mercurial-devel mailing list