changeset 30482:55ec13c82ea0

bookmarks: use listbinbookmarks() in listbookmarks()
author Stanislau Hlebik <stash@fb.com>
date Thu, 17 Nov 2016 00:59:41 -0800
parents 0a3b11a7489a
children 8491845a75b2
files mercurial/bookmarks.py
diffstat 1 files changed, 2 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/bookmarks.py	Thu Nov 17 00:59:41 2016 -0800
+++ b/mercurial/bookmarks.py	Thu Nov 17 00:59:41 2016 -0800
@@ -296,16 +296,9 @@
             yield k, v
 
 def listbookmarks(repo):
-    # We may try to list bookmarks on a repo type that does not
-    # support it (e.g., statichttprepository).
-    marks = getattr(repo, '_bookmarks', {})
-
     d = {}
-    hasnode = repo.changelog.hasnode
-    for k, v in marks.iteritems():
-        # don't expose local divergent bookmarks
-        if hasnode(v) and ('@' not in k or k.endswith('@')):
-            d[k] = hex(v)
+    for book, node in listbinbookmarks(repo):
+        d[book] = hex(node)
     return d
 
 def pushbookmark(repo, key, old, new):