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

login
register
mail settings
Submitter Lucas Moscovicz
Date Feb. 11, 2014, 8:55 p.m.
Message ID <d066984274ccaaabbc32.1392152122@dev1037.prn2.facebook.com>
Download mbox | patch
Permalink /patch/3580/
State Deferred
Headers show

Comments

Matt Mackall - Feb. 11, 2014, 7:20 p.m.
On Tue, 2014-02-11 at 12:55 -0800, Lucas Moscovicz wrote:
> # HG changeset patch
> # User Lucas Moscovicz <lmoscovicz@fb.com>
> # Date 1391131291 28800
> #      Thu Jan 30 17:21:31 2014 -0800
> # Node ID d066984274ccaaabbc324a5ed18972ca08df9aec
> # Parent  bd6b1d895339c2dfe98051653bc17fc23a0bb8c3
> revset: added lazyset implementation to branchpoint revset

Pushed the first 6, thanks.

This one and the next one look they're still doing most of the work up
front.
Lucas Moscovicz - Feb. 11, 2014, 8:55 p.m.
# HG changeset patch
# User Lucas Moscovicz <lmoscovicz@fb.com>
# Date 1391131291 28800
#      Thu Jan 30 17:21:31 2014 -0800
# Node ID d066984274ccaaabbc324a5ed18972ca08df9aec
# Parent  bd6b1d895339c2dfe98051653bc17fc23a0bb8c3
revset: added lazyset implementation to branchpoint revset

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -1009,7 +1009,7 @@ 
         for p in cl.parentrevs(r):
             if p >= baserev:
                 parentscount[p - baserev] += 1
-    return baseset([r for r in subset if (parentscount[r - baserev] > 1)])
+    return lazyset(subset, lambda r: parentscount[r - baserev] > 1)
 
 def minrev(repo, subset, x):
     """``min(set)``