Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
30825:4deb7c1a07ab | 30826:923336cf8b8a |
---|---|
970 lessvars['revcount'] = max(revcount / 2, 1) | 970 lessvars['revcount'] = max(revcount / 2, 1) |
971 morevars = copy.copy(tmpl.defaults['sessionvars']) | 971 morevars = copy.copy(tmpl.defaults['sessionvars']) |
972 morevars['revcount'] = revcount * 2 | 972 morevars['revcount'] = revcount * 2 |
973 | 973 |
974 count = fctx.filerev() + 1 | 974 count = fctx.filerev() + 1 |
975 start = max(0, fctx.filerev() - revcount + 1) # first rev on this page | 975 start = max(0, count - revcount) # first rev on this page |
976 end = min(count, start + revcount) # last rev on this page | 976 end = min(count, start + revcount) # last rev on this page |
977 parity = paritygen(web.stripecount, offset=start - end) | 977 parity = paritygen(web.stripecount, offset=start - end) |
978 | 978 |
979 repo = web.repo | 979 repo = web.repo |
980 revs = fctx.filelog().revs(start, end - 1) | 980 revs = fctx.filelog().revs(start, end - 1) |