[PATCH 1 of 2] hgweb: restore ascending iteration on revs in filelog web command

Denis Laxalde denis at laxalde.org
Tue Jan 17 08:43:42 UTC 2017


# HG changeset patch
# User Denis Laxalde <denis.laxalde at logilab.fr>
# Date 1484641049 -3600
#      Tue Jan 17 09:17:29 2017 +0100
# Node ID 71e542e7d3df0ac9a48e1021bb5319405a307f87
# Parent  4c0a5a256ae806fab18d56b3c44a8d1c98a40ce0
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.

diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -974,12 +974,12 @@ def filelog(web, req, tmpl):
     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 @@ def filelog(web, req, tmpl):
             file=f,
             rename=webutil.renamelink(iterfctx),
             **webutil.commonentry(repo, iterfctx)))
+    entries.reverse()
 
     latestentry = entries[:1]
 


More information about the Mercurial-devel mailing list