Patchwork [02,of,11] revset: use `subset &` in `bookmark`

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 23, 2014, 10:47 p.m.
Message ID <95f560abd67f59042d60.1411512468@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5933/
State Accepted
Headers show

Comments

Pierre-Yves David - Sept. 23, 2014, 10:47 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1411009029 25200
#      Wed Sep 17 19:57:09 2014 -0700
# Node ID 95f560abd67f59042d60e544b9a85ff25e5a642c
# Parent  a7099a4d87d791914c9a907da1add2993c00b384
revset: use `subset &` in `bookmark`

Speedup, Weeeeeee!

revset #0: bookmark()
0) wall 0.002240 comb 0.000000 user 0.000000 sys 0.000000 (best of 571)
1) wall 0.000132 comb 0.000000 user 0.000000 sys 0.000000 (best of 14059)

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -466,11 +466,11 @@  def bookmark(repo, subset, x):
                 bms.add(repo[bmrev].rev())
     else:
         bms = set([repo[r].rev()
                    for r in repo._bookmarks.values()])
     bms -= set([node.nullrev])
-    return subset.filter(bms.__contains__)
+    return subset & bms
 
 def branch(repo, subset, x):
     """``branch(string or set)``
     All changesets belonging to the given branch or the branches of the given
     changesets.