mercurial/scmutil.py
changeset 46040 9ee791f3278f
parent 46039 b9ebe0bfed4e
child 46042 1bf2b44c4007
--- a/mercurial/scmutil.py	Tue Dec 01 19:46:01 2020 +0900
+++ b/mercurial/scmutil.py	Tue Dec 01 19:23:23 2020 +0900
@@ -2304,7 +2304,13 @@
 
     If the bookmarked revision isn't a head, an empty set will be returned.
     """
-    return repo.revs(
+    return repo.revs(format_bookmark_revspec(mark))
+
+
+def format_bookmark_revspec(mark):
+    """Build a revset expression to select revisions reachable by a given
+    bookmark"""
+    return revsetlang.formatspec(
         b"ancestors(bookmark(%s)) - "
         b"ancestors(head() and not bookmark(%s)) - "
         b"ancestors(bookmark() and not bookmark(%s))",