revset: use `subset &` in `divergent`
authorPierre-Yves David <pierre-yves.david@fb.com>
Wed, 17 Sep 2014 10:58:39 -0700
changeset 22533 5b65429721d5
parent 22532 0cf46b8298fe
child 22534 6261b9c549a2
revset: use `subset &` in `divergent` This takes advantage of the `fullreposet` smartness. revset #0: divergent() 0) wall 0.002047 comb 0.000000 user 0.000000 sys 0.000000 (best of 813) 1) wall 0.000052 comb 0.000000 user 0.000000 sys 0.000000 (best of 22757)
mercurial/revset.py
--- a/mercurial/revset.py	Wed Sep 17 10:57:57 2014 -0700
+++ b/mercurial/revset.py	Wed Sep 17 10:58:39 2014 -0700
@@ -734,7 +734,7 @@
     # i18n: "divergent" is a keyword
     getargs(x, 0, 0, _("divergent takes no arguments"))
     divergent = obsmod.getrevs(repo, 'divergent')
-    return subset.filter(divergent.__contains__)
+    return subset & divergent
 
 def draft(repo, subset, x):
     """``draft()``