Patchwork [1,of,4,RFC] hgweb: move local changelist function to the beginning of the parent one

login
register
mail settings
Submitter Alexander Plavin
Date July 14, 2013, 9:45 p.m.
Message ID <28d3d31e969f8e539455.1373838326@debian-alexander.dolgopa>
Download mbox | patch
Permalink /patch/1893/
State Accepted
Commit 55b9d98a1ef4fc2499703bf575d2305204bc4edc
Headers show

Comments

Alexander Plavin - July 14, 2013, 9:45 p.m.
# HG changeset patch
# User Alexander Plavin <me@aplavin.ru>
# Date 1373835942 -14400
#      Mon Jul 15 01:05:42 2013 +0400
# Node ID 28d3d31e969f8e539455963953962c87a1025066
# Parent  e146f595973442ae97cb6fdbe6f9d37ebf95cb34
hgweb: move local changelist function to the beginning of the parent one
Matt Mackall - July 17, 2013, 7:31 p.m.
On Mon, 2013-07-15 at 01:45 +0400, Alexander Plavin wrote:
> # HG changeset patch
> # User Alexander Plavin <me@aplavin.ru>
> # Date 1373835942 -14400
> #      Mon Jul 15 01:05:42 2013 +0400
> # Node ID 28d3d31e969f8e539455963953962c87a1025066
> # Parent  e146f595973442ae97cb6fdbe6f9d37ebf95cb34
> hgweb: move local changelist function to the beginning of the parent one

Queued this one for default, thanks.

Patch

diff -r e146f5959734 -r 28d3d31e969f mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Sun Jul 14 05:35:04 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)