D4314: setdiscovery: use a revset instead of dagutil.descendantset()

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Fri Aug 17 21:30:52 UTC 2018


indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This is the only use of descendantset() in the repo.
  
  Strictly speaking, the revset behaves slightly differently than
  dagutil. The reason is that dagutil is using revlog.index for
  DAG traversal and this data structure isn't aware of visibility /
  filtering. So it can operate on revisions it shouldn't operate on.
  
  But our test coverage of this code is pretty comprehensive and
  this change causes no tests to fail. So I think we are good.
  
  Also, the revset parser failed to parse `%ld:: - %ld::`, hence
  the use of descendants(). I'm not sure if that is a feature or
  a bug.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/setdiscovery.py

CHANGE DETAILS

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -215,7 +215,12 @@
 
         if sample:
             missinginsample = [n for i, n in enumerate(sample) if not yesno[i]]
-            missing.update(dag.descendantset(missinginsample, missing))
+
+            if missing:
+                missing.update(local.revs('descendants(%ld) - descendants(%ld)',
+                                          missinginsample, missing))
+            else:
+                missing.update(local.revs('descendants(%ld)', missinginsample))
 
             undecided.difference_update(missing)
 



To: indygreg, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list