# HG changeset patch # User Denis Laxalde # Date 2017-01-17 08:19:24 # Node ID 923336cf8b8afdb41746ecef8a39d773bd5538bf # Parent 4deb7c1a07ab92cb1dc2f814eb744774844daa83 hgweb: simplify calculation of first revision in filelog command diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -972,7 +972,7 @@ def filelog(web, req, tmpl): morevars['revcount'] = revcount * 2 count = fctx.filerev() + 1 - start = max(0, fctx.filerev() - revcount + 1) # first rev on this page + start = max(0, count - revcount) # first rev on this page end = min(count, start + revcount) # last rev on this page parity = paritygen(web.stripecount, offset=start - end)