Patchwork [3,of,8] revset: added lazyset implementation to filelog revset

login
register
mail settings
Submitter Lucas Moscovicz
Date Feb. 11, 2014, 9:54 p.m.
Message ID <f34fe1564f148a4c6e70.1392155681@dev1037.prn2.facebook.com>
Download mbox | patch
Permalink /patch/3589/
State Accepted
Headers show

Comments

Lucas Moscovicz - Feb. 11, 2014, 9:54 p.m.
# HG changeset patch
# User Lucas Moscovicz <lmoscovicz@fb.com>
# Date 1391473699 28800
#      Mon Feb 03 16:28:19 2014 -0800
# Node ID f34fe1564f148a4c6e70e2e0e1409f8f723cf772
# Parent  bccc2dbcf3b60c9c2d0721c7ca5ebd09fa460c50
revset: added lazyset implementation to filelog revset
Matt Mackall - Feb. 11, 2014, 10:51 p.m.
On Tue, 2014-02-11 at 13:54 -0800, Lucas Moscovicz wrote:
> # HG changeset patch
> # User Lucas Moscovicz <lmoscovicz@fb.com>
> # Date 1391473699 28800
> #      Mon Feb 03 16:28:19 2014 -0800
> # Node ID f34fe1564f148a4c6e70e2e0e1409f8f723cf772
> # Parent  bccc2dbcf3b60c9c2d0721c7ca5ebd09fa460c50
> revset: added lazyset implementation to filelog revset
> 
> diff --git a/mercurial/revset.py b/mercurial/revset.py
> --- a/mercurial/revset.py
> +++ b/mercurial/revset.py
> @@ -742,7 +742,7 @@
>                  for fr in fl:
>                      s.add(fl.linkrev(fr))
>  
> -    return baseset([r for r in subset if r in s])
> +    return subset & s

Another instance of "we did all the real work already".

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -742,7 +742,7 @@ 
                 for fr in fl:
                     s.add(fl.linkrev(fr))
 
-    return baseset([r for r in subset if r in s])
+    return subset & s
 
 def first(repo, subset, x):
     """``first(set, [n])``