Patchwork [1,of,4] scmutil: document that bookmarkrevs() ignores non-head bookmark branch

login
register
mail settings
Submitter Yuya Nishihara
Date Dec. 1, 2020, 12:50 p.m.
Message ID <4439db4d98bc5d5d05b7.1606827031@lemosa>
Download mbox | patch
Permalink /patch/47754/
State Accepted
Headers show

Comments

Yuya Nishihara - Dec. 1, 2020, 12:50 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1606819561 -32400
#      Tue Dec 01 19:46:01 2020 +0900
# Node ID 4439db4d98bc5d5d05b709d0886cb81b1347516e
# Parent  d42809b6b10ff91cf6fcad5914e77c6974195e78
scmutil: document that bookmarkrevs() ignores non-head bookmark branch

"- ancestors(head() and not bookmark(%s))" excludes the bookmarked branch
itself if bookmark(%s) is not a head. I'm a bit surprised by this behavior
while writing "log -B" tests, so let's document it.

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -2300,8 +2300,9 @@  def _getrevsfromsymbols(repo, symbols):
 
 
 def bookmarkrevs(repo, mark):
-    """
-    Select revisions reachable by a given bookmark
+    """Select revisions reachable by a given bookmark
+
+    If the bookmarked revision isn't a head, an empty set will be returned.
     """
     return repo.revs(
         b"ancestors(bookmark(%s)) - "