hgweb: use changelog for iteration
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Fri, 11 Jan 2013 01:08:00 +0100
changeset 18427 56ca4443a343
parent 18426 01638b51df44
child 18428 8c10f760ca34
hgweb: use changelog for iteration Iterating through changelog is necessary to enforce filtering.
mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py	Wed Jan 16 14:19:28 2013 +0100
+++ b/mercurial/hgweb/webcommands.py	Fri Jan 11 01:08:00 2013 +0100
@@ -196,10 +196,13 @@
 
     def changelist(latestonly, **map):
         l = [] # build a list in forward order for efficiency
+        revs = []
+        if start < end:
+            revs = web.repo.changelog.revs(start, end - 1)
         if latestonly:
-            revs = (end - 1,)
-        else:
-            revs = xrange(start, end)
+            for r in revs:
+                pass
+            revs = (r,)
         for i in revs:
             ctx = web.repo[i]
             n = ctx.node()
@@ -745,10 +748,11 @@
         l = []
 
         repo = web.repo
+        revs = repo.changelog.revs(start, end - 1)
         if latestonly:
-            revs = (end - 1,)
-        else:
-            revs = xrange(start, end)
+            for r in revs:
+                pass
+            revs = (r,)
         for i in revs:
             iterfctx = fctx.filectx(i)