Patchwork D1993: discovery: don't reimplement all()

login
register
mail settings
Submitter phabricator
Date Feb. 1, 2018, 11:30 p.m.
Message ID <differential-rev-PHID-DREV-pmxthwxgdwkeiohwso2z-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/27185/
State Superseded
Headers show

Comments

phabricator - Feb. 1, 2018, 11:30 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D1993

AFFECTED FILES
  mercurial/discovery.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel

Patch

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,