# HG changeset patch # User Kevin Bullock # Date 1359321233 21600 # Node ID d1c13a4dc638cefc71728da24f91a723313b049e # Parent 8260fa9f30b952048ed8961bbb76a62204334b98 bookmarks: hide bookmarks on filtered revs from listkeys Don't expose unserved changesets to remote repos. Thanks to Sean Farley for tracking down the issue and Pierre-Yves David for the fix. diff -r 8260fa9f30b9 -r d1c13a4dc638 mercurial/bookmarks.py --- a/mercurial/bookmarks.py Sun Jan 27 14:24:37 2013 -0600 +++ b/mercurial/bookmarks.py Sun Jan 27 15:13:53 2013 -0600 @@ -183,9 +183,10 @@ marks = getattr(repo, '_bookmarks', {}) d = {} + hasnode = repo.changelog.hasnode for k, v in marks.iteritems(): # don't expose local divergent bookmarks - if '@' not in k or k.endswith('@'): + if hasnode(v) and ('@' not in k or k.endswith('@')): d[k] = hex(v) return d diff -r 8260fa9f30b9 -r d1c13a4dc638 tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t Sun Jan 27 14:24:37 2013 -0600 +++ b/tests/test-hgweb-commands.t Sun Jan 27 15:13:53 2013 -0600 @@ -1386,4 +1386,10 @@ $ QUERY_STRING='style=raw' $ python hgweb.cgi +listbookmarks hides secret bookmarks + + $ PATH_INFO=/; export PATH_INFO + $ QUERY_STRING='cmd=listkeys&namespace=bookmarks' + $ python hgweb.cgi + $ cd ..