[PATCH 2 of 8] revset: added lazyset implementation bookmark revset

Lucas Moscovicz lmoscovicz at fb.com
Tue Feb 11 14:55:17 CST 2014


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

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)``


More information about the Mercurial-devel mailing list