diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py --- a/mercurial/bookmarks.py +++ b/mercurial/bookmarks.py @@ -460,6 +460,8 @@ marks.applychanges(repo, tr, bmchanges) return bool(bmchanges) +def isdivergent(b): + return b'@' in b and not b.endswith(b'@') def listbinbookmarks(repo): # We may try to list bookmarks on a repo type that does not @@ -469,7 +471,7 @@ hasnode = repo.changelog.hasnode for k, v in pycompat.iteritems(marks): # don't expose local divergent bookmarks - if hasnode(v) and (b'@' not in k or k.endswith(b'@')): + if hasnode(v) and not isdivergent(k): yield k, v