changeset 5597:e7f99a3ed008

hgweb: extract constant to global level
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Mon, 03 Dec 2007 12:06:21 +0100
parents 20b07b68a865
children d534ba1c4eb4
files mercurial/hgweb/hgweb_mod.py
diffstat 1 files changed, 15 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py	Mon Dec 03 11:58:52 2007 +0100
+++ b/mercurial/hgweb/hgweb_mod.py	Mon Dec 03 12:06:21 2007 +0100
@@ -14,6 +14,21 @@
 from request import wsgirequest
 import webcommands
 
+shortcuts = {
+    'cl': [('cmd', ['changelog']), ('rev', None)],
+    'sl': [('cmd', ['shortlog']), ('rev', None)],
+    'cs': [('cmd', ['changeset']), ('node', None)],
+    'f': [('cmd', ['file']), ('filenode', None)],
+    'fl': [('cmd', ['filelog']), ('filenode', None)],
+    'fd': [('cmd', ['filediff']), ('node', None)],
+    'fa': [('cmd', ['annotate']), ('filenode', None)],
+    'mf': [('cmd', ['manifest']), ('manifest', None)],
+    'ca': [('cmd', ['archive']), ('node', None)],
+    'tags': [('cmd', ['tags'])],
+    'tip': [('cmd', ['changeset']), ('node', ['tip'])],
+    'static': [('cmd', ['static']), ('file', None)]
+}
+
 def _up(p):
     if p[0] != "/":
         p = "/" + p
@@ -123,21 +138,6 @@
 
         # expand form shortcuts
 
-        shortcuts = {
-            'cl': [('cmd', ['changelog']), ('rev', None)],
-            'sl': [('cmd', ['shortlog']), ('rev', None)],
-            'cs': [('cmd', ['changeset']), ('node', None)],
-            'f': [('cmd', ['file']), ('filenode', None)],
-            'fl': [('cmd', ['filelog']), ('filenode', None)],
-            'fd': [('cmd', ['filediff']), ('node', None)],
-            'fa': [('cmd', ['annotate']), ('filenode', None)],
-            'mf': [('cmd', ['manifest']), ('manifest', None)],
-            'ca': [('cmd', ['archive']), ('node', None)],
-            'tags': [('cmd', ['tags'])],
-            'tip': [('cmd', ['changeset']), ('node', ['tip'])],
-            'static': [('cmd', ['static']), ('file', None)]
-        }
-
         for k in shortcuts.iterkeys():
             if k in req.form:
                 for name, value in shortcuts[k]: