--- a/mercurial/treediscovery.py Fri Dec 11 13:39:56 2020 -0800
+++ b/mercurial/treediscovery.py Fri Dec 11 12:51:09 2020 +0100
@@ -20,7 +20,7 @@
)
-def findcommonincoming(repo, remote, heads=None, force=False):
+def findcommonincoming(repo, remote, heads=None, force=False, audit=None):
"""Return a tuple (common, fetch, heads) used to identify the common
subset of nodes between repo and remote.
@@ -41,6 +41,9 @@
with remote.commandexecutor() as e:
heads = e.callcommand(b'heads', {}).result()
+ if audit is not None:
+ audit[b'total-roundtrips'] = 1
+
if repo.changelog.tip() == nullid:
base.add(nullid)
if heads != [nullid]:
@@ -181,5 +184,7 @@
progress.complete()
repo.ui.debug(b"%d total queries\n" % reqcnt)
+ if audit is not None:
+ audit[b'total-roundtrips'] = reqcnt
return base, list(fetch), heads