diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -606,13 +606,13 @@ def bookmarks(web, req, tmpl): The ``bookmarks`` template is rendered. """ i = [b for b in web.repo._bookmarks.items() if b[1] in web.repo] + i = sorted(i) parity = paritygen(web.stripecount) def entries(latestonly, **map): + t = i if latestonly: - t = [min(i)] - else: - t = sorted(i) + t = i[:1] for k, n in t: yield {"parity": parity.next(), "bookmark": k, diff --git a/tests/test-hgweb-empty.t b/tests/test-hgweb-empty.t --- a/tests/test-hgweb-empty.t +++ b/tests/test-hgweb-empty.t @@ -461,4 +461,20 @@ Some tests for hgweb in an empty reposit + $ (get-with-headers.py localhost:$HGPORT 'atom-bookmarks') + 200 Script output follows + + + + http://*:$HGPORT/ (glob) + (glob) + (glob) + test: bookmarks + test bookmark history + Mercurial SCM + + + + + $ cd ..