Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 38780:ede3bf31fe63 stable 4.7.1
hgweb: load revcount + 1 entries to fill nextentry in log page (issue5972)
"revcount + 1" is moved to the call site to make it clearer.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Fri, 31 Aug 2018 21:44:24 +0900 |
parents | 5caee9f923ae |
children | 6268fed317d0 |
comparison
equal
deleted
inserted
replaced
38779:d750a6c9248d | 38780:ede3bf31fe63 |
---|---|
392 return _search(web) | 392 return _search(web) |
393 else: | 393 else: |
394 ctx = web.repo['tip'] | 394 ctx = web.repo['tip'] |
395 symrev = 'tip' | 395 symrev = 'tip' |
396 | 396 |
397 def changelist(): | 397 def changelist(maxcount): |
398 revs = [] | 398 revs = [] |
399 if pos != -1: | 399 if pos != -1: |
400 revs = web.repo.changelog.revs(pos, 0) | 400 revs = web.repo.changelog.revs(pos, 0) |
401 | 401 |
402 for entry in webutil.changelistentries(web, revs, revcount, parity): | 402 for entry in webutil.changelistentries(web, revs, maxcount, parity): |
403 yield entry | 403 yield entry |
404 | 404 |
405 if shortlog: | 405 if shortlog: |
406 revcount = web.maxshortchanges | 406 revcount = web.maxshortchanges |
407 else: | 407 else: |
424 pos = ctx.rev() | 424 pos = ctx.rev() |
425 parity = paritygen(web.stripecount) | 425 parity = paritygen(web.stripecount) |
426 | 426 |
427 changenav = webutil.revnav(web.repo).gen(pos, revcount, count) | 427 changenav = webutil.revnav(web.repo).gen(pos, revcount, count) |
428 | 428 |
429 entries = list(changelist()) | 429 entries = list(changelist(revcount + 1)) |
430 latestentry = entries[:1] | 430 latestentry = entries[:1] |
431 if len(entries) > revcount: | 431 if len(entries) > revcount: |
432 nextentry = entries[-1:] | 432 nextentry = entries[-1:] |
433 entries = entries[:-1] | 433 entries = entries[:-1] |
434 else: | 434 else: |