Patchwork D6147: discovery: move cl.hasnode outside of the for-loop

login
register
mail settings
Submitter phabricator
Date March 27, 2019, 7:37 p.m.
Message ID <f65cf5e671e4486a1c2eaef9db4a4707@localhost.localdomain>
Download mbox | patch
Permalink /patch/39406/
State Not Applicable
Headers show

Comments

phabricator - March 27, 2019, 7:37 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG19ccc6788a27: discovery: move cl.hasnode outside of the for-loop (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6147?vs=14539&id=14602

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

AFFECTED FILES
  mercurial/discovery.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: lothiraldan, mercurial-devel

Patch

diff --git a/mercurial/discovery.py b/mercurial/discovery.py
--- a/mercurial/discovery.py
+++ b/mercurial/discovery.py
@@ -212,14 +212,14 @@ 
     with remote.commandexecutor() as e:
         remotemap = e.callcommand('branchmap', {}).result()
 
+    knownnode = cl.hasnode # do not use nodemap until it is filtered
     # A. register remote heads of branches which are in outgoing set
     for branch, heads in remotemap.iteritems():
         # don't add head info about branches which we don't have locally
         if branch not in branches:
             continue
         known = []
         unsynced = []
-        knownnode = cl.hasnode # do not use nodemap until it is filtered
         for h in heads:
             if knownnode(h):
                 known.append(h)