Patchwork [2,of,5,command,metadata,resend] commands: move metadata variables to top of file

login
register
mail settings
Submitter Gregory Szorc
Date June 13, 2014, 6:24 p.m.
Message ID <f64d04384a4feb390913.1402683858@gps-mbp.local>
Download mbox | patch
Permalink /patch/4996/
State Accepted
Headers show

Comments

Gregory Szorc - June 13, 2014, 6:24 p.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1402683191 25200
#      Fri Jun 13 11:13:11 2014 -0700
# Node ID f64d04384a4feb3909135c1ec33b34f3e718f031
# Parent  b6aa82933dc87e6e48dc40331d612ff425ae4f66
commands: move metadata variables to top of file

A subsequent commit will reference the moved variables from the
@command decorator. Since decorators are evaluated at module load
time, these variables wouldn't be defined yet if they were at their
current location.

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -25,8 +25,15 @@  import phases, obsolete, exchange
 table = {}
 
 command = cmdutil.command(table)
 
+norepo = ("clone init version help debugcommands debugcomplete"
+          " debugdate debuginstall debugfsinfo debugpushkey debugwireargs"
+          " debugknown debuggetbundle debugbundle")
+optionalrepo = ("identify paths serve config showconfig debugancestor debugdag"
+                " debugdata debugindex debugindexdot debugrevlog")
+inferrepo = ("add addremove annotate cat commit diff grep forget log parents"
+             " remove resolve status debugwalk")
 # common command options
 
 globalopts = [
     ('R', 'repository', '',
@@ -5962,12 +5969,4 @@  def version_(ui):
         "This is free software; see the source for copying conditions. "
         "There is NO\nwarranty; "
         "not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
     ))
-
-norepo = ("clone init version help debugcommands debugcomplete"
-          " debugdate debuginstall debugfsinfo debugpushkey debugwireargs"
-          " debugknown debuggetbundle debugbundle")
-optionalrepo = ("identify paths serve config showconfig debugancestor debugdag"
-                " debugdata debugindex debugindexdot debugrevlog")
-inferrepo = ("add addremove annotate cat commit diff grep forget log parents"
-             " remove resolve status debugwalk")