Mercurial > public > mercurial-scm > hg
diff mercurial/hgweb/webcommands.py @ 30826:923336cf8b8a
hgweb: simplify calculation of first revision in filelog command
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Tue, 17 Jan 2017 09:19:24 +0100 |
parents | 4deb7c1a07ab |
children | aea06029919e |
line wrap: on
line diff
--- 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)