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

login
register
mail settings
Submitter Boris Feld
Date Aug. 29, 2018, 4:30 p.m.
Message ID <2127e141f56510b109f9.1535560249@localhost.localdomain>
Download mbox | patch
Permalink /patch/34147/
State Accepted
Headers show

Comments

Boris Feld - Aug. 29, 2018, 4:30 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@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.
Pulkit Goyal - Aug. 29, 2018, 4:47 p.m.
On Wed, Aug 29, 2018 at 7:30 PM Boris Feld <boris.feld@octobus.net> wrote:

> # HG changeset patch
> # User Boris Feld <boris.feld@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.
>

Queued the first three patches. Many thanks!

Patch

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()