Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 30825:4deb7c1a07ab
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.
author | Denis Laxalde <denis.laxalde@logilab.fr> |
---|---|
date | Tue, 17 Jan 2017 09:17:29 +0100 |
parents | 96f811bceb85 |
children | 923336cf8b8a |
comparison
equal
deleted
inserted
replaced
30824:6e1d54be7588 | 30825:4deb7c1a07ab |
---|---|
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, fctx.filerev() - revcount + 1) # 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 + 1) | 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) |
981 entries = [] | 981 entries = [] |
982 for i in reversed(revs): | 982 for i in revs: |
983 iterfctx = fctx.filectx(i) | 983 iterfctx = fctx.filectx(i) |
984 entries.append(dict( | 984 entries.append(dict( |
985 parity=next(parity), | 985 parity=next(parity), |
986 filerev=i, | 986 filerev=i, |
987 file=f, | 987 file=f, |
988 rename=webutil.renamelink(iterfctx), | 988 rename=webutil.renamelink(iterfctx), |
989 **webutil.commonentry(repo, iterfctx))) | 989 **webutil.commonentry(repo, iterfctx))) |
990 entries.reverse() | |
990 | 991 |
991 latestentry = entries[:1] | 992 latestentry = entries[:1] |
992 | 993 |
993 revnav = webutil.filerevnav(web.repo, fctx.path()) | 994 revnav = webutil.filerevnav(web.repo, fctx.path()) |
994 nav = revnav.gen(end - 1, revcount, count) | 995 nav = revnav.gen(end - 1, revcount, count) |