Patchwork [2,of,8] revset: added lazyset implementation bookmark revset

login
register
mail settings
Submitter Lucas Moscovicz
Date Feb. 11, 2014, 8:55 p.m.
Message ID <61bc268f1a6de48f034b.1392152117@dev1037.prn2.facebook.com>
Download mbox | patch
Permalink /patch/3573/
State Accepted
Commit 4f1aed2c7a7e045245d97b43e2dc79d876ccb6f4
Headers show

Comments

Lucas Moscovicz - Feb. 11, 2014, 8:55 p.m.
# HG changeset patch
# User Lucas Moscovicz <lmoscovicz@fb.com>
# Date 1391037796 28800
#      Wed Jan 29 15:23:16 2014 -0800
# Node ID 61bc268f1a6de48f034b049f75f276d7ad67226c
# Parent  42080ca95bda3a82c7738e23d77785107de41bf8
revset: added lazyset implementation bookmark revset

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -391,7 +391,7 @@ 
             if not bmrev:
                 raise util.Abort(_("bookmark '%s' does not exist") % bm)
             bmrev = repo[bmrev].rev()
-            return baseset([r for r in subset if r == bmrev])
+            return lazyset(subset, lambda r: r == bmrev)
         else:
             matchrevs = set()
             for name, bmrev in repo._bookmarks.iteritems():
@@ -407,7 +407,7 @@ 
 
     bms = set([repo[r].rev()
                for r in repo._bookmarks.values()])
-    return baseset([r for r in subset if r in bms])
+    return lazyset(subset, lambda r: r in bms)
 
 def branch(repo, subset, x):
     """``branch(string or set)``