comparison mercurial/hgweb/webcommands.py @ 26130:e466c15597a3

hgweb: use webutil.branchentries for branches on summary page This allows showing correct status for each branch, which was missing on /summary. Usually that means that closed branches get the same css class (resulting in e.g. different color/shade) as they do on /branches page. The sorting of the branches on summary page also changes and is now the same as on /branches page: closed branches are now at the end of the list.
author Anton Shestakov <av6@dwimlabs.net>
date Tue, 01 Sep 2015 23:29:30 +0800
parents a103ecb8a04a
children 0a9009d56fea
comparison
equal deleted inserted replaced
26129:a103ecb8a04a 26130:e466c15597a3
683 yield {'parity': parity.next(), 683 yield {'parity': parity.next(),
684 'bookmark': k, 684 'bookmark': k,
685 'date': web.repo[n].date(), 685 'date': web.repo[n].date(),
686 'node': hex(n)} 686 'node': hex(n)}
687 687
688 def branches(**map):
689 parity = paritygen(web.stripecount)
690
691 b = web.repo.branchmap()
692 l = [(-web.repo.changelog.rev(tip), tip, tag)
693 for tag, heads, tip, closed in b.iterbranches()]
694 for r, n, t in sorted(l):
695 yield {'parity': parity.next(),
696 'branch': t,
697 'node': hex(n),
698 'date': web.repo[n].date()}
699
700 def changelist(**map): 688 def changelist(**map):
701 parity = paritygen(web.stripecount, offset=start - end) 689 parity = paritygen(web.stripecount, offset=start - end)
702 l = [] # build a list in forward order for efficiency 690 l = [] # build a list in forward order for efficiency
703 revs = [] 691 revs = []
704 if start < end: 692 if start < end:
734 desc=web.config("web", "description", "unknown"), 722 desc=web.config("web", "description", "unknown"),
735 owner=get_contact(web.config) or "unknown", 723 owner=get_contact(web.config) or "unknown",
736 lastchange=tip.date(), 724 lastchange=tip.date(),
737 tags=tagentries, 725 tags=tagentries,
738 bookmarks=bookmarks, 726 bookmarks=bookmarks,
739 branches=branches, 727 branches=webutil.branchentries(web.repo, web.stripecount),
740 shortlog=changelist, 728 shortlog=changelist,
741 node=tip.hex(), 729 node=tip.hex(),
742 symrev='tip', 730 symrev='tip',
743 archives=web.archivelist("tip")) 731 archives=web.archivelist("tip"))
744 732