Patchwork D9800: discovery: move some debug output closer to were it belong

login
register
mail settings
Submitter phabricator
Date Jan. 16, 2021, 12:26 a.m.
Message ID <differential-rev-PHID-DREV-vkkmytjjmlnpj7dpvmsx-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48109/
State Superseded
Headers show

Comments

phabricator - Jan. 16, 2021, 12:26 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  I assume these debug output, increment and comment drifted over time.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/setdiscovery.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
--- a/mercurial/setdiscovery.py
+++ b/mercurial/setdiscovery.py
@@ -314,9 +314,6 @@ 
     else:
         ownheads = [rev for rev in cl.headrevs() if rev != nullrev]
 
-    # early exit if we know all the specified remote heads already
-    ui.debug(b"query 1; heads\n")
-    roundtrips += 1
     # We also ask remote about all the local heads. That set can be arbitrarily
     # large, so we used to limit it size to `initialsamplesize`. We no longer
     # do as it proved counter productive. The skipped heads could lead to a
@@ -375,6 +372,8 @@ 
     else:
         sample = ownheads
 
+    ui.debug(b"query 1; heads\n")
+    roundtrips += 1
     with remote.commandexecutor() as e:
         fheads = e.callcommand(b'heads', {})
         fknown = e.callcommand(
@@ -409,6 +408,7 @@ 
         except error.LookupError:
             continue
 
+    # early exit if we know all the specified remote heads already
     if len(knownsrvheads) == len(srvheadhashes):
         ui.debug(b"all remote heads known locally\n")
         return srvheadhashes, False, srvheadhashes