Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 18427:56ca4443a343
hgweb: use changelog for iteration
Iterating through changelog is necessary to enforce filtering.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Fri, 11 Jan 2013 01:08:00 +0100 |
parents | e3f5cef11d6a |
children | 8c10f760ca34 |
comparison
equal
deleted
inserted
replaced
18426:01638b51df44 | 18427:56ca4443a343 |
---|---|
194 except error.RepoError: | 194 except error.RepoError: |
195 return _search(web, req, tmpl) # XXX redirect to 404 page? | 195 return _search(web, req, tmpl) # XXX redirect to 404 page? |
196 | 196 |
197 def changelist(latestonly, **map): | 197 def changelist(latestonly, **map): |
198 l = [] # build a list in forward order for efficiency | 198 l = [] # build a list in forward order for efficiency |
199 revs = [] | |
200 if start < end: | |
201 revs = web.repo.changelog.revs(start, end - 1) | |
199 if latestonly: | 202 if latestonly: |
200 revs = (end - 1,) | 203 for r in revs: |
201 else: | 204 pass |
202 revs = xrange(start, end) | 205 revs = (r,) |
203 for i in revs: | 206 for i in revs: |
204 ctx = web.repo[i] | 207 ctx = web.repo[i] |
205 n = ctx.node() | 208 n = ctx.node() |
206 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n) | 209 showtags = webutil.showtag(web.repo, tmpl, 'changelogtag', n) |
207 files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles) | 210 files = webutil.listfilediffs(tmpl, ctx.files(), n, web.maxfiles) |
743 | 746 |
744 def entries(latestonly, **map): | 747 def entries(latestonly, **map): |
745 l = [] | 748 l = [] |
746 | 749 |
747 repo = web.repo | 750 repo = web.repo |
751 revs = repo.changelog.revs(start, end - 1) | |
748 if latestonly: | 752 if latestonly: |
749 revs = (end - 1,) | 753 for r in revs: |
750 else: | 754 pass |
751 revs = xrange(start, end) | 755 revs = (r,) |
752 for i in revs: | 756 for i in revs: |
753 iterfctx = fctx.filectx(i) | 757 iterfctx = fctx.filectx(i) |
754 | 758 |
755 l.append({"parity": parity.next(), | 759 l.append({"parity": parity.next(), |
756 "filerev": i, | 760 "filerev": i, |