From patchwork Thu Feb 1 23:50:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D1993: discovery: don't reimplement all() From: phabricator X-Patchwork-Id: 27208 Message-Id: <3a692c50429e2aa0ad2c0350213b0b13@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Thu, 1 Feb 2018 23:50:31 +0000 This revision was automatically updated to reflect the committed changes. Closed by commit rHG5523aabb85c3: discovery: don't reimplement all() (authored by martinvonz, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1993?vs=5117&id=5140 REVISION DETAIL https://phab.mercurial-scm.org/D1993 AFFECTED FILES mercurial/discovery.py CHANGE DETAILS To: martinvonz, #hg-reviewers, indygreg Cc: mercurial-devel diff --git a/mercurial/discovery.py b/mercurial/discovery.py --- a/mercurial/discovery.py +++ b/mercurial/discovery.py @@ -53,13 +53,8 @@ return treediscovery.findcommonincoming(repo, remote, heads, force) if heads: - allknown = True knownnode = repo.changelog.hasnode # no nodemap until it is filtered - for h in heads: - if not knownnode(h): - allknown = False - break - if allknown: + if all(knownnode(h) for h in heads): return (heads, False, heads) res = setdiscovery.findcommonheads(repo.ui, repo, remote, heads,