changeset 19418:55b9d98a1ef4

hgweb: move local changelist function to the beginning of the parent one
author Alexander Plavin <me@aplavin.ru>
date Mon, 15 Jul 2013 01:05:42 +0400
parents 78d1e1029aa4
children e823abe577a2
files mercurial/hgweb/webcommands.py
diffstat 1 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- 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)