Patchwork [10,of,23,Series-D] hgweb: drop recursivity in _navseq

login
register
mail settings
Submitter Pierre-Yves David
Date Jan. 11, 2013, 12:23 a.m.
Message ID <bb8ee9a95c02cd79e3e2.1357863835@yamac.lan>
Download mbox | patch
Permalink /patch/554/
State Superseded
Headers show

Comments

Pierre-Yves David - Jan. 11, 2013, 12:23 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@logilab.fr>
# Date 1357839866 -3600
# Node ID bb8ee9a95c02cd79e3e220f01a8f635fb56498f1
# Parent  35401f390daa6e095af3bf0d1b8098ee0eea7b5c
hgweb: drop recursivity in _navseq

This is totally not needed.

Patch

diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -27,15 +27,15 @@  def up(p):
 def _navseq(factor, limit=None):
     if limit:
         yield limit
         if limit >= 20 and limit <= 40:
             yield 50
-    else:
+        factor *= 10
+    while True:
         yield 1 * factor
         yield 3 * factor
-    for f in _navseq(factor * 10):
-        yield f
+        factor *= 10
 
 class revnav(object):
 
     def __init__(self, nodefunc):
         """Navigation generation object