##// END OF EJS Templates
hgweb: sort bookmarks early...
av6 -
r28710:ca0c0ca3 default
parent child Browse files
Show More
@@ -606,13 +606,13 b' def bookmarks(web, req, tmpl):'
606 The ``bookmarks`` template is rendered.
606 The ``bookmarks`` template is rendered.
607 """
607 """
608 i = [b for b in web.repo._bookmarks.items() if b[1] in web.repo]
608 i = [b for b in web.repo._bookmarks.items() if b[1] in web.repo]
609 i = sorted(i)
609 parity = paritygen(web.stripecount)
610 parity = paritygen(web.stripecount)
610
611
611 def entries(latestonly, **map):
612 def entries(latestonly, **map):
613 t = i
612 if latestonly:
614 if latestonly:
613 t = [min(i)]
615 t = i[:1]
614 else:
615 t = sorted(i)
616 for k, n in t:
616 for k, n in t:
617 yield {"parity": parity.next(),
617 yield {"parity": parity.next(),
618 "bookmark": k,
618 "bookmark": k,
@@ -461,4 +461,20 b' Some tests for hgweb in an empty reposit'
461 </html>
461 </html>
462
462
463
463
464 $ (get-with-headers.py localhost:$HGPORT 'atom-bookmarks')
465 200 Script output follows
466
467 <?xml version="1.0" encoding="ascii"?>
468 <feed xmlns="http://www.w3.org/2005/Atom">
469 <id>http://*:$HGPORT/</id> (glob)
470 <link rel="self" href="http://*:$HGPORT/atom-bookmarks"/> (glob)
471 <link rel="alternate" href="http://*:$HGPORT/bookmarks"/> (glob)
472 <title>test: bookmarks</title>
473 <summary>test bookmark history</summary>
474 <author><name>Mercurial SCM</name></author>
475
476
477
478 </feed>
479
464 $ cd ..
480 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now