bookmarks: use listbinbookmarks() in listbookmarks()
authorStanislau Hlebik <stash@fb.com>
Thu, 17 Nov 2016 00:59:41 -0800
changeset 30482 55ec13c82ea0
parent 30481 0a3b11a7489a
child 30483 8491845a75b2
bookmarks: use listbinbookmarks() in listbookmarks()
mercurial/bookmarks.py
--- 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):