Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/hgweb/webcommands.py @ 29382:e4b777fe1576
templates: add support for summary webcommand in json style
Change summary webcommand to yield each element of the shortlog instead of the
entire list.
This makes generated json more readable since each entry can be formatted
separately, instead of returning all the shortlog content in a single string.
author | Laura M?dioni <laura.medioni@logilab.fr> |
---|---|
date | Mon, 06 Jun 2016 15:14:11 +0200 |
parents | 4f2f8baba2ff |
children | f694e20193f2 |
comparison
equal
deleted
inserted
replaced
29381:8bfe44494a0d | 29382:e4b777fe1576 |
---|---|
705 l.append(tmpl( | 705 l.append(tmpl( |
706 'shortlogentry', | 706 'shortlogentry', |
707 parity=next(parity), | 707 parity=next(parity), |
708 **webutil.commonentry(web.repo, ctx))) | 708 **webutil.commonentry(web.repo, ctx))) |
709 | 709 |
710 l.reverse() | 710 for entry in reversed(l): |
711 yield l | 711 yield entry |
712 | 712 |
713 tip = web.repo['tip'] | 713 tip = web.repo['tip'] |
714 count = len(web.repo) | 714 count = len(web.repo) |
715 start = max(0, count - web.maxchanges) | 715 start = max(0, count - web.maxchanges) |
716 end = min(count, start + web.maxchanges) | 716 end = min(count, start + web.maxchanges) |