Patchwork [16,of,25,RFC] shelve: move createcmd next to _docreatecmd

login
register
mail settings
Submitter Boris Feld
Date June 7, 2018, 2:11 p.m.
Message ID <49bb8db412ebe0580d1a.1528380675@Laptop-Boris.lan>
Download mbox | patch
Permalink /patch/32010/
State New
Headers show

Comments

Boris Feld - June 7, 2018, 2:11 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1527585696 -7200
#      Tue May 29 11:21:36 2018 +0200
# Node ID 49bb8db412ebe0580d1a2d65edb218cf738f6bde
# Parent  fb3ee0a32dd588db82f7bfd7708cba25ad0d7c5c
# EXP-Topic internal-phase
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 49bb8db412eb
shelve: move createcmd next to _docreatecmd

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

Patch

diff --git a/hgext/shelve.py b/hgext/shelve.py
--- a/hgext/shelve.py
+++ b/hgext/shelve.py
@@ -319,12 +319,6 @@  def _aborttransaction(repo):
     tr.abort()
     repo.dirstate.restorebackup(None, backupname)
 
-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():
@@ -426,6 +420,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()