mercurial/hgweb/webutil.py
changeset 37913 89db78126f7f
parent 37912 16c7a6ac8f94
child 37914 10d3dc8123c5
equal deleted inserted replaced
37912:16c7a6ac8f94 37913:89db78126f7f
   290     tips = []
   290     tips = []
   291     heads = repo.heads()
   291     heads = repo.heads()
   292     parity = paritygen(stripecount)
   292     parity = paritygen(stripecount)
   293     sortkey = lambda item: (not item[1], item[0].rev())
   293     sortkey = lambda item: (not item[1], item[0].rev())
   294 
   294 
   295     def entries(**map):
   295     def entries(context):
   296         count = 0
   296         count = 0
   297         if not tips:
   297         if not tips:
   298             for tag, hs, tip, closed in repo.branchmap().iterbranches():
   298             for tag, hs, tip, closed in repo.branchmap().iterbranches():
   299                 tips.append((repo[tip], closed))
   299                 tips.append((repo[tip], closed))
   300         for ctx, closed in sorted(tips, key=sortkey, reverse=True):
   300         for ctx, closed in sorted(tips, key=sortkey, reverse=True):
   313                 'status': status,
   313                 'status': status,
   314                 'node': ctx.hex(),
   314                 'node': ctx.hex(),
   315                 'date': ctx.date()
   315                 'date': ctx.date()
   316             }
   316             }
   317 
   317 
   318     return entries
   318     return templateutil.mappinggenerator(entries)
   319 
   319 
   320 def cleanpath(repo, path):
   320 def cleanpath(repo, path):
   321     path = path.lstrip('/')
   321     path = path.lstrip('/')
   322     return pathutil.canonpath(repo.root, '', path)
   322     return pathutil.canonpath(repo.root, '', path)
   323 
   323