changeset 22539:6f434ef54222

revset: use `subset &` in bare `p2()` This takes advantage of the `fullreposet` smartness with a nice speedup. It's a similar speedup to `p1()` when a merge is in progress (the non merge case is already lightning fast anyway.)
author Pierre-Yves David <pierre-yves.david@fb.com>
date Wed, 17 Sep 2014 11:00:03 -0700
parents a428db9ab61d
children 9a860ac8c216
files mercurial/revset.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Wed Sep 17 10:59:52 2014 -0700
+++ b/mercurial/revset.py	Wed Sep 17 11:00:03 2014 -0700
@@ -1217,7 +1217,9 @@
         ps = repo[x].parents()
         try:
             p = ps[1].rev()
-            return subset.filter(lambda r: r == p)
+            if p >= 0:
+                return subset & baseset([p])
+            return baseset([])
         except IndexError:
             return baseset([])