Patchwork dispatch: load debugcommand before extension

login
register
mail settings
Submitter Pierre-Yves David
Date Feb. 13, 2017, 4:07 p.m.
Message ID <135b457a4a6684f868a7.1487002027@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/18438/
State Accepted
Headers show

Comments

Pierre-Yves David - Feb. 13, 2017, 4:07 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1487000149 -3600
#      Mon Feb 13 16:35:49 2017 +0100
# Node ID 135b457a4a6684f868a71cd0e10356297ec10ffe
# Parent  7cf05675ef46c679852bbc13e9a0424d3ec5f5a9
# EXP-Topic debugcommands
dispatch: load debugcommand before extension

Multiple extension will manipulate commands on load, we need the debug command
to be loaded before that point.
Augie Fackler - Feb. 13, 2017, 7:29 p.m.
On Mon, Feb 13, 2017 at 05:07:07PM +0100, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> # Date 1487000149 -3600
> #      Mon Feb 13 16:35:49 2017 +0100
> # Node ID 135b457a4a6684f868a71cd0e10356297ec10ffe
> # Parent  7cf05675ef46c679852bbc13e9a0424d3ec5f5a9
> # EXP-Topic debugcommands
> dispatch: load debugcommand before extension

Queued this, thanks.

>
> Multiple extension will manipulate commands on load, we need the debug command
> to be loaded before that point.
>
> diff -r 7cf05675ef46 -r 135b457a4a66 mercurial/dispatch.py
> --- a/mercurial/dispatch.py	Thu Feb 02 10:04:02 2017 +0100
> +++ b/mercurial/dispatch.py	Mon Feb 13 16:35:49 2017 +0100
> @@ -655,6 +655,10 @@ def _dispatch(req):
>      rpath = _earlygetopt(["-R", "--repository", "--repo"], args)
>      path, lui = _getlocal(ui, rpath)
>
> +    # Side-effect of accessing is debugcommands module is guaranteed to be
> +    # imported and commands.table is populated.
> +    debugcommands.command
> +
>      # Configure extensions in phases: uisetup, extsetup, cmdtable, and
>      # reposetup. Programs like TortoiseHg will call _dispatch several
>      # times so we keep track of configured extensions in _loaded.
> @@ -674,10 +678,6 @@ def _dispatch(req):
>
>      # (reposetup is handled in hg.repository)
>
> -    # Side-effect of accessing is debugcommands module is guaranteed to be
> -    # imported and commands.table is populated.
> -    debugcommands.command
> -
>      addaliases(lui, commands.table)
>
>      # All aliases and commands are completely defined, now.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff -r 7cf05675ef46 -r 135b457a4a66 mercurial/dispatch.py
--- a/mercurial/dispatch.py	Thu Feb 02 10:04:02 2017 +0100
+++ b/mercurial/dispatch.py	Mon Feb 13 16:35:49 2017 +0100
@@ -655,6 +655,10 @@  def _dispatch(req):
     rpath = _earlygetopt(["-R", "--repository", "--repo"], args)
     path, lui = _getlocal(ui, rpath)
 
+    # Side-effect of accessing is debugcommands module is guaranteed to be
+    # imported and commands.table is populated.
+    debugcommands.command
+
     # Configure extensions in phases: uisetup, extsetup, cmdtable, and
     # reposetup. Programs like TortoiseHg will call _dispatch several
     # times so we keep track of configured extensions in _loaded.
@@ -674,10 +678,6 @@  def _dispatch(req):
 
     # (reposetup is handled in hg.repository)
 
-    # Side-effect of accessing is debugcommands module is guaranteed to be
-    # imported and commands.table is populated.
-    debugcommands.command
-
     addaliases(lui, commands.table)
 
     # All aliases and commands are completely defined, now.