[PATCH 2 of 2] discovery: log discovery result in non-trivial cases

Yuya Nishihara yuya at tcha.org
Thu Jun 8 10:36:28 EDT 2017


On Wed, 07 Jun 2017 11:27:40 +0100, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david at octobus.net>
> # Date 1496828651 -3600
> #      Wed Jun 07 10:44:11 2017 +0100
> # Node ID 7ad4af1e46dae15170b2ad25750e857d3d5398d4
> # Parent  264a9933cead269d3c28156b9b87890ef4cfb06a
> # EXP-Topic discovery
> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 7ad4af1e46da
> discovery: log discovery result in non-trivial cases

Looks good, queued, thanks.

> diff --git a/mercurial/setdiscovery.py b/mercurial/setdiscovery.py
> --- a/mercurial/setdiscovery.py
> +++ b/mercurial/setdiscovery.py
> @@ -241,6 +241,9 @@ def findcommonheads(ui, local, remote,
>      elapsed = util.timer() - start
>      ui.progress(_('searching'), None)
>      ui.debug("%d total queries in %.4fs\n" % (roundtrips, elapsed))
> +    msg = 'found %d common and %d missing heads, %d roundtrips in %.4fs\n'
> +    ui.log('discovery', msg, len(result), len(srvheadhashes), roundtrips,
> +           elapsed)

Maybe len(srvheadhashes) could be 1 if it is [nullid] ?
>  
>      if not result and srvheadhashes != [nullid]:
>          if abortwhenunrelated:


More information about the Mercurial-devel mailing list