comparison mercurial/hgweb/webcommands.py @ 19462:a87d9102f7af

hgweb: always start log with searched revision This makes the specified revision be always on top of the list. Before the patch, for example with repo having revisions 0, 1, 2, 3 and user searching for '2', all revisions were shown and the specified one wasn't the first.
author Alexander Plavin <me@aplavin.ru>
date Sat, 13 Jul 2013 02:36:29 +0400
parents f5abfa08fb09
children 02c71f96eb6c
comparison
equal deleted inserted replaced
19461:dd7c992d3cc1 19462:a87d9102f7af
245 morevars['revcount'] = revcount * 2 245 morevars['revcount'] = revcount * 2
246 246
247 count = len(web.repo) 247 count = len(web.repo)
248 pos = ctx.rev() 248 pos = ctx.rev()
249 start = max(0, pos - revcount + 1) 249 start = max(0, pos - revcount + 1)
250 end = min(count, start + revcount) 250 end = pos + 1
251 pos = end - 1
252 parity = paritygen(web.stripecount, offset=start - end) 251 parity = paritygen(web.stripecount, offset=start - end)
253 252
254 changenav = webutil.revnav(web.repo).gen(pos, revcount, count) 253 changenav = webutil.revnav(web.repo).gen(pos, revcount, count)
255 254
256 return tmpl(shortlog and 'shortlog' or 'changelog', changenav=changenav, 255 return tmpl(shortlog and 'shortlog' or 'changelog', changenav=changenav,