Patchwork [04,of,11] revset: use `subset &` in `bisect`

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 23, 2014, 10:47 p.m.
Message ID <a29e99d8280b35694255.1411512470@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5936/
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 1410976677 25200
#      Wed Sep 17 10:57:57 2014 -0700
# Node ID a29e99d8280b35694255f0b70d88206c0ff56bba
# Parent  9b7673d405d4a9f5d386844e074a6c02a73c4ea2
revset: use `subset &` in `bisect`

This take advantage of the `fullreposet` smartness

revset #0: bisect(range)
0) wall 0.014007 comb 0.010000 user 0.010000 sys 0.000000 (best of 115)
1) wall 0.005556 comb 0.010000 user 0.010000 sys 0.000000 (best of 235)

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -424,11 +424,11 @@  def bisect(repo, subset, x):
     - ``current``            : the cset currently being bisected
     """
     # i18n: "bisect" is a keyword
     status = getstring(x, _("bisect requires a string")).lower()
     state = set(hbisect.get(repo, status))
-    return subset.filter(state.__contains__)
+    return subset & state
 
 # Backward-compatibility
 # - no help entry so that we do not advertise it any more
 def bisected(repo, subset, x):
     return bisect(repo, subset, x)