[PATCH 08 of 11] revset: use `subset &` in `origin`

Pierre-Yves David pierre-yves.david at ens-lyon.org
Tue Sep 23 17:47:54 CDT 2014


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1411008754 25200
#      Wed Sep 17 19:52:34 2014 -0700
# Node ID becb27aa41249d70db42517bfced03100115b005
# Parent  248f0c8c29fd8c341845c187cb19fcfceeef5e3d
revset: use `subset &` in `origin`

This take advantage of the `fullreposet` smartness.

revset #0: origin(tip)
0) wall 0.005353 comb 0.000000 user 0.000000 sys 0.000000 (best of 354)
1) wall 0.003080 comb 0.000000 user 0.000000 sys 0.000000 (best of 446)

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -1165,11 +1165,11 @@ def origin(repo, subset, x):
                 return src
             src = prev
 
     o = set([_firstsrc(r) for r in args])
     o -= set([None])
-    return subset.filter(o.__contains__)
+    return subset & o
 
 def outgoing(repo, subset, x):
     """``outgoing([path])``
     Changesets not found in the specified destination repository, or the
     default push location.


More information about the Mercurial-devel mailing list