Patchwork D8116: bookmarks: refactor in preparation for next commit

login
register
mail settings
Submitter phabricator
Date Feb. 21, 2020, 9:55 a.m.
Message ID <e5e32c69e11caa1e16a9c19a6c412f05@localhost.localdomain>
Download mbox | patch
Permalink /patch/45284/
State Not Applicable
Headers show

Comments

phabricator - Feb. 21, 2020, 9:55 a.m.
Closed by commit rHG0275000564c4: bookmarks: refactor in preparation for next commit (authored by valentin.gatienbaron).
This revision was automatically updated to reflect the committed changes.

CHANGED PRIOR TO COMMIT
  https://phab.mercurial-scm.org/D8116?vs=20210&id=20271#toc

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8116?vs=20210&id=20271

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8116/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8116

AFFECTED FILES
  mercurial/bookmarks.py

CHANGE DETAILS




To: valentin.gatienbaron, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/mercurial/bookmarks.py b/mercurial/bookmarks.py
--- a/mercurial/bookmarks.py
+++ b/mercurial/bookmarks.py
@@ -463,6 +463,10 @@ 
     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
     # support it (e.g., statichttprepository).
@@ -471,7 +475,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