hideablerevs: expand docstring to warn about possible traps
authorPierre-Yves David <pierre-yves.david@fb.com>
Sat, 02 Apr 2016 15:56:47 -0700
changeset 31116 faff8c2b5ee338606c86e8865e2a483c1a142e7c
parent 31115 0970ebec29b4304d36b7fd5c558a4d52aa03c26d
child 31117 c042b98a6ff8ee65a681f4a14c71c37c20193c16
push id213
push usergszorc@mozilla.com
push dateSat, 09 Apr 2016 16:50:24 +0000
hideablerevs: expand docstring to warn about possible traps Sean Farley just wasted multiple hours trying to figure out why his code was crashing. We update the docstring to make the constraint clearer.
mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -17,19 +17,24 @@ from . import (
     error,
     obsolete,
     phases,
     tags as tagsmod,
     util,
 )
 
 def hideablerevs(repo):
-    """Revisions candidates to be hidden
+    """Revision candidates to be hidden
+
+    This is a standalone function to allow extensions to wrap it.
 
-    This is a standalone function to help extensions to wrap it."""
+    Because we use the set of immutable changesets as a fallback subset in
+    branchmap (see mercurial.branchmap.subsettable), you cannot set "public"
+    changesets as "hideable". Doing so would break multiple code assertions and
+    lead to crashes."""
     return obsolete.getrevs(repo, 'obsolete')
 
 def _getstatichidden(repo):
     """Revision to be hidden (disregarding dynamic blocker)
 
     To keep a consistent graph, we cannot hide any revisions with
     non-hidden descendants. This function computes the set of
     revisions that could be hidden while keeping the graph consistent.