Patchwork [06,of,11] revset: use `subset &` in `filelog`

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 23, 2014, 10:47 p.m.
Message ID <b490e3c27abff630d7c5.1411512472@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5938/
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 1410976730 25200
#      Wed Sep 17 10:58:50 2014 -0700
# Node ID b490e3c27abff630d7c5b6a69ae09d65394a4873
# Parent  f740a9975e010f8268684d08872b190fe0d59de5
revset: use `subset &` in `filelog`

This take advantage of the `fullreposet` smartness

revset #0: file(COPYING)
0) wall 3.179066 comb 3.180000 user 3.140000 sys 0.040000 (best of 3)
1) wall 2.723699 comb 2.730000 user 2.690000 sys 0.040000 (best of 4)

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -809,11 +809,11 @@  def filelog(repo, subset, x):
             if m(f):
                 fl = repo.file(f)
                 for fr in fl:
                     s.add(fl.linkrev(fr))
 
-    return subset.filter(s.__contains__)
+    return subset & s
 
 def first(repo, subset, x):
     """``first(set, [n])``
     An alias for limit().
     """