hgweb: move local changelist function to the beginning of the parent one
authorAlexander Plavin <me@aplavin.ru>
Mon, 15 Jul 2013 01:05:42 +0400
changeset 19418 55b9d98a1ef4
parent 19417 78d1e1029aa4
child 19419 e823abe577a2
hgweb: move local changelist function to the beginning of the parent one
mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Sat Jul 13 17:51:24 2013 +0400
+++ b/mercurial/hgweb/webcommands.py	Mon Jul 15 01:05:42 2013 +0400
@@ -110,20 +110,6 @@
 
 def _search(web, req, tmpl):
 
-    query = req.form['rev'][0]
-    revcount = web.maxchanges
-    if 'revcount' in req.form:
-        revcount = int(req.form.get('revcount', [revcount])[0])
-        revcount = max(revcount, 1)
-        tmpl.defaults['sessionvars']['revcount'] = revcount
-
-    lessvars = copy.copy(tmpl.defaults['sessionvars'])
-    lessvars['revcount'] = max(revcount / 2, 1)
-    lessvars['rev'] = query
-    morevars = copy.copy(tmpl.defaults['sessionvars'])
-    morevars['revcount'] = revcount * 2
-    morevars['rev'] = query
-
     def changelist(**map):
         count = 0
         lower = encoding.lower
@@ -176,6 +162,20 @@
             if count >= revcount:
                 break
 
+    query = req.form['rev'][0]
+    revcount = web.maxchanges
+    if 'revcount' in req.form:
+        revcount = int(req.form.get('revcount', [revcount])[0])
+        revcount = max(revcount, 1)
+        tmpl.defaults['sessionvars']['revcount'] = revcount
+
+    lessvars = copy.copy(tmpl.defaults['sessionvars'])
+    lessvars['revcount'] = max(revcount / 2, 1)
+    lessvars['rev'] = query
+    morevars = copy.copy(tmpl.defaults['sessionvars'])
+    morevars['revcount'] = revcount * 2
+    morevars['rev'] = query
+
     tip = web.repo['tip']
     parity = paritygen(web.stripecount)