Patchwork [01,of,11] revset: use `subset &` in `outgoing`

login
register
mail settings
Submitter Pierre-Yves David
Date Sept. 23, 2014, 10:47 p.m.
Message ID <a7099a4d87d791914c9a.1411512467@marginatus.alto.octopoid.net>
Download mbox | patch
Permalink /patch/5934/
State Accepted
Headers show

Comments

Pierre-Yves David - Sept. 23, 2014, 10:47 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@fb.com>
# Date 1410976780 25200
#      Wed Sep 17 10:59:40 2014 -0700
# Node ID a7099a4d87d791914c9a907da1add2993c00b384
# Parent  03863d1788fbf0dddebcf0885373f28ffe176442
revset: use `subset &` in `outgoing`

This should give use the same benefit than elsewhere. Result is simpler (and
"faster").

Outgoing is dominated by the discovery so no benchmark is provided.

Patch

diff --git a/mercurial/revset.py b/mercurial/revset.py
--- a/mercurial/revset.py
+++ b/mercurial/revset.py
@@ -1188,11 +1188,11 @@  def outgoing(repo, subset, x):
     repo.ui.pushbuffer()
     outgoing = discovery.findcommonoutgoing(repo, other, onlyheads=revs)
     repo.ui.popbuffer()
     cl = repo.changelog
     o = set([cl.rev(r) for r in outgoing.missing])
-    return subset.filter(o.__contains__)
+    return subset & o
 
 def p1(repo, subset, x):
     """``p1([set])``
     First parent of changesets in set, or the working directory.
     """