changeset 4542:af02e6078d08

dispatch: reorder functions
author Matt Mackall <mpm@selenic.com>
date Mon, 11 Jun 2007 21:09:23 -0500
parents 3f4555babe74
children 6b4e8a75d5fc
files mercurial/commands.py
diffstat 1 files changed, 19 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3033,6 +3033,9 @@ norepo = ("clone init version help debug
           " debugindex debugindexdot debugdate debuginstall")
 optionalrepo = ("paths serve showconfig")
 
+def run():
+    sys.exit(dispatch(sys.argv[1:]))
+
 def findpossible(ui, cmd):
     """
     Return cmd -> (aliases, command table entry)
@@ -3079,12 +3082,6 @@ def findcmd(ui, cmd):
 
     raise UnknownCommand(cmd)
 
-def catchterm(*args):
-    raise util.SignalInterrupt
-
-def run():
-    sys.exit(dispatch(sys.argv[1:]))
-
 class ParseError(Exception):
     """Exception raised on errors in parsing the command line."""
 
@@ -3126,6 +3123,20 @@ def parse(ui, args):
 
     return (cmd, cmd and i[0] or None, args, options, cmdoptions)
 
+def parseconfig(config):
+    """parse the --config options from the command line"""
+    parsed = []
+    for cfg in config:
+        try:
+            name, value = cfg.split('=', 1)
+            section, name = name.split('.', 1)
+            if not section or not name:
+                raise IndexError
+            parsed.append((section, name, value))
+        except (IndexError, ValueError):
+            raise util.Abort(_('malformed --config option: %s') % cfg)
+    return parsed
+
 external = {}
 
 def findext(name):
@@ -3185,19 +3196,8 @@ def load_extensions(ui):
                     % (name, " ".join(overrides)))
         table.update(cmdtable)
 
-def parseconfig(config):
-    """parse the --config options from the command line"""
-    parsed = []
-    for cfg in config:
-        try:
-            name, value = cfg.split('=', 1)
-            section, name = name.split('.', 1)
-            if not section or not name:
-                raise IndexError
-            parsed.append((section, name, value))
-        except (IndexError, ValueError):
-            raise util.Abort(_('malformed --config option: %s') % cfg)
-    return parsed
+def catchterm(*args):
+    raise util.SignalInterrupt
 
 def dispatch(args):
     for name in 'SIGBREAK', 'SIGHUP', 'SIGTERM':