hgweb: use changelog for iteration
Iterating through changelog is necessary to enforce filtering.
--- 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)