Patchwork [07,of,11] revset: use `subset &` in `follow`

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 23, 2014, 10:47 p.m.
Message ID <248f0c8c29fd8c341845.1411512473@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5939/
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 1410976756 25200
#      Wed Sep 17 10:59:16 2014 -0700
# Node ID 248f0c8c29fd8c341845c187cb19fcfceeef5e3d
# Parent  b490e3c27abff630d7c5b6a69ae09d65394a4873
revset: use `subset &` in `follow`

This take advantage of the `fullreposet` smartness.


revset #0: follow(COPYING)
0) wall 0.002446 comb 0.000000 user 0.000000 sys 0.000000 (best of 735)
1) wall 0.000331 comb 0.000000 user 0.000000 sys 0.000000 (best of 5672)

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -832,11 +832,11 @@  def _follow(repo, subset, x, name, follo
         else:
             return baseset([])
     else:
         s = _revancestors(repo, baseset([c.rev()]), followfirst)
 
-    return subset.filter(s.__contains__)
+    return subset & s
 
 def follow(repo, subset, x):
     """``follow([file])``
     An alias for ``::.`` (ancestors of the working copy's first parent).
     If a filename is specified, the history of the given file is followed,