mercurial/hgweb/webcommands.py
changeset 13923 2176c5babd53
parent 13922 b8dd2e95b0ca
child 13924 ea726c97c1b6
equal deleted inserted replaced
13922:b8dd2e95b0ca 13923:2176c5babd53
   393 
   393 
   394 def bookmarks(web, req, tmpl):
   394 def bookmarks(web, req, tmpl):
   395     i = web.repo._bookmarks.items()
   395     i = web.repo._bookmarks.items()
   396     parity = paritygen(web.stripecount)
   396     parity = paritygen(web.stripecount)
   397 
   397 
   398     def entries(notip=False, limit=0, **map):
   398     def entries(limit=0, **map):
   399         count = 0
   399         count = 0
   400         for k, n in sorted(i):
   400         for k, n in sorted(i):
   401             if notip and k == "tip":
       
   402                 continue
       
   403             if limit > 0 and count >= limit:
   401             if limit > 0 and count >= limit:
   404                 continue
   402                 continue
   405             count = count + 1
   403             count = count + 1
   406             yield {"parity": parity.next(),
   404             yield {"parity": parity.next(),
   407                    "bookmark": k,
   405                    "bookmark": k,
   408                    "date": web.repo[n].date(),
   406                    "date": web.repo[n].date(),
   409                    "node": hex(n)}
   407                    "node": hex(n)}
   410 
   408 
   411     return tmpl("bookmarks",
   409     return tmpl("bookmarks",
   412                 node=hex(web.repo.changelog.tip()),
   410                 node=hex(web.repo.changelog.tip()),
   413                 entries=lambda **x: entries(False, 0, **x),
   411                 entries=lambda **x: entries(0, **x),
   414                 entriesnotip=lambda **x: entries(True, 0, **x),
   412                 latestentry=lambda **x: entries(1, **x))
   415                 latestentry=lambda **x: entries(True, 1, **x))
       
   416 
   413 
   417 def branches(web, req, tmpl):
   414 def branches(web, req, tmpl):
   418     tips = (web.repo[n] for t, n in web.repo.branchtags().iteritems())
   415     tips = (web.repo[n] for t, n in web.repo.branchtags().iteritems())
   419     heads = web.repo.heads()
   416     heads = web.repo.heads()
   420     parity = paritygen(web.stripecount)
   417     parity = paritygen(web.stripecount)