diff -r 4deb7c1a07ab -r 923336cf8b8a mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Tue Jan 17 09:17:29 2017 +0100 +++ b/mercurial/hgweb/webcommands.py Tue Jan 17 09:19:24 2017 +0100 @@ -972,7 +972,7 @@ 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)