diff mercurial/commands.py @ 21767:75a96326cecb

commands: add norepo argument to command decorator Since decorators are evaluated at module load time and since the @command decorator imports commands, the norepo variable (along with its friends) may not be declared yet. These variables are now declared before @command usage to ensure they are present.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sun, 04 May 2014 20:58:25 -0700
parents 0c6cdbb697d9
children 16aeb28caaa6
line wrap: on
line diff
--- a/mercurial/commands.py	Sun May 04 18:45:04 2014 -0700
+++ b/mercurial/commands.py	Sun May 04 20:58:25 2014 -0700
@@ -26,6 +26,13 @@
 
 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 = [
@@ -5977,11 +5984,3 @@
         "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")