changeset 30825:4deb7c1a07ab

hgweb: restore ascending iteration on revs in filelog web command Follow-up on 96f811bceb85. Adjust back the "parity" generator's offset to keep rendering the same.
author Denis Laxalde <denis.laxalde@logilab.fr>
date Tue, 17 Jan 2017 09:17:29 +0100
parents 6e1d54be7588
children 923336cf8b8a
files mercurial/hgweb/webcommands.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/webcommands.py	Mon Jan 16 09:22:32 2017 +0100
+++ b/mercurial/hgweb/webcommands.py	Tue Jan 17 09:17:29 2017 +0100
@@ -974,12 +974,12 @@
     count = fctx.filerev() + 1
     start = max(0, fctx.filerev() - revcount + 1) # first rev on this page
     end = min(count, start + revcount) # last rev on this page
-    parity = paritygen(web.stripecount, offset=start - end + 1)
+    parity = paritygen(web.stripecount, offset=start - end)
 
     repo = web.repo
     revs = fctx.filelog().revs(start, end - 1)
     entries = []
-    for i in reversed(revs):
+    for i in revs:
         iterfctx = fctx.filectx(i)
         entries.append(dict(
             parity=next(parity),
@@ -987,6 +987,7 @@
             file=f,
             rename=webutil.renamelink(iterfctx),
             **webutil.commonentry(repo, iterfctx)))
+    entries.reverse()
 
     latestentry = entries[:1]