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

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

Comments

Lucas Moscovicz - Feb. 11, 2014, 9:54 p.m.
# HG changeset patch
# User Lucas Moscovicz <lmoscovicz@fb.com>
# Date 1391704146 28800
#      Thu Feb 06 08:29:06 2014 -0800
# Node ID bb1982623c024de93176abdc948cf0f406b81290
# Parent  a3511bebf9907e660721a370bda20c1a8b6aacae
revset: added lazyset implementation to ancestorspec revset
Matt Mackall - Feb. 11, 2014, 10:54 p.m.
On Tue, 2014-02-11 at 13:54 -0800, Lucas Moscovicz wrote:
> # HG changeset patch
> # User Lucas Moscovicz <lmoscovicz@fb.com>
> # Date 1391704146 28800
> #      Thu Feb 06 08:29:06 2014 -0800
> # Node ID bb1982623c024de93176abdc948cf0f406b81290
> # Parent  a3511bebf9907e660721a370bda20c1a8b6aacae
> revset: added lazyset implementation to ancestorspec revset

This one too. I've queued the others, thanks.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -338,7 +338,7 @@ 
         for i in range(n):
             r = cl.parentrevs(r)[0]
         ps.add(r)
-    return baseset([r for r in subset if r in ps])
+    return lazyset(subset, lambda r: r in ps)
 
 def author(repo, subset, x):
     """``author(string)``