comparison mercurial/hgweb/webcommands.py @ 19485:02c71f96eb6c stable

hgweb: always start graph with the revision in url It is the same fix for graph command, as was recently for log. This makes the specified revision be always on top of the graph view. Before the patch, for example with repo having revisions 0, 1, 2, 3 and revision in url being '2', all revisions were shown and the specified one wasn't the first.
author Alexander Plavin <me@aplavin.ru>
date Thu, 25 Jul 2013 02:48:21 +0400
parents a87d9102f7af
children 002b711a3e8a
comparison
equal deleted inserted replaced
19484:a987972de0e6 19485:02c71f96eb6c
877 morevars['revcount'] = revcount * 2 877 morevars['revcount'] = revcount * 2
878 878
879 count = len(web.repo) 879 count = len(web.repo)
880 pos = rev 880 pos = rev
881 start = max(0, pos - revcount + 1) 881 start = max(0, pos - revcount + 1)
882 end = min(count, start + revcount) 882 end = pos + 1
883 pos = end - 1
884 883
885 uprev = min(max(0, count - 1), rev + revcount) 884 uprev = min(max(0, count - 1), rev + revcount)
886 downrev = max(0, rev - revcount) 885 downrev = max(0, rev - revcount)
887 changenav = webutil.revnav(web.repo).gen(pos, revcount, count) 886 changenav = webutil.revnav(web.repo).gen(pos, revcount, count)
888 887