mercurial/hgweb/webcommands.py
changeset 38134 edacd831afab
parent 38063 3c995af3066e
child 38135 5e94d07b290a
equal deleted inserted replaced
38133:dce718404ce6 38134:edacd831afab
   646     i = [b for b in web.repo._bookmarks.items() if b[1] in web.repo]
   646     i = [b for b in web.repo._bookmarks.items() if b[1] in web.repo]
   647     sortkey = lambda b: (web.repo[b[1]].rev(), b[0])
   647     sortkey = lambda b: (web.repo[b[1]].rev(), b[0])
   648     i = sorted(i, key=sortkey, reverse=True)
   648     i = sorted(i, key=sortkey, reverse=True)
   649     parity = paritygen(web.stripecount)
   649     parity = paritygen(web.stripecount)
   650 
   650 
   651     def entries(latestonly, **map):
   651     def entries(context, latestonly):
   652         t = i
   652         t = i
   653         if latestonly:
   653         if latestonly:
   654             t = i[:1]
   654             t = i[:1]
   655         for k, n in t:
   655         for k, n in t:
   656             yield {"parity": next(parity),
   656             yield {"parity": next(parity),
   665 
   665 
   666     return web.sendtemplate(
   666     return web.sendtemplate(
   667         'bookmarks',
   667         'bookmarks',
   668         node=hex(web.repo.changelog.tip()),
   668         node=hex(web.repo.changelog.tip()),
   669         lastchange=[{'date': web.repo[latestrev].date()}],
   669         lastchange=[{'date': web.repo[latestrev].date()}],
   670         entries=lambda **x: entries(latestonly=False, **x),
   670         entries=templateutil.mappinggenerator(entries, args=(False,)),
   671         latestentry=lambda **x: entries(latestonly=True, **x))
   671         latestentry=templateutil.mappinggenerator(entries, args=(True,)))
   672 
   672 
   673 @webcommand('branches')
   673 @webcommand('branches')
   674 def branches(web):
   674 def branches(web):
   675     """
   675     """
   676     /branches
   676     /branches