Mercurial > public > mercurial-scm > hg
diff mercurial/debugcommands.py @ 46110:d90f439ff19f
debugdiscovery: display the number of roundtrip used
This is a good metric of the complexity of a discovery process.
Differential Revision: https://phab.mercurial-scm.org/D9565
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 11 Dec 2020 12:51:09 +0100 |
parents | 0e5065b6baa0 |
children | 9e24b3d8e896 |
line wrap: on
line diff
--- a/mercurial/debugcommands.py Fri Dec 11 13:39:56 2020 -0800 +++ b/mercurial/debugcommands.py Fri Dec 11 12:51:09 2020 +0100 @@ -978,6 +978,7 @@ # make sure tests are repeatable random.seed(int(opts[b'seed'])) + data = {} if opts.get(b'old'): def doit(pushedrevs, remoteheads, remote=remote): @@ -985,7 +986,7 @@ # enable in-client legacy support remote = localrepo.locallegacypeer(remote.local()) common, _in, hds = treediscovery.findcommonincoming( - repo, remote, force=True + repo, remote, force=True, audit=data ) common = set(common) if not opts.get(b'nonheads'): @@ -1007,7 +1008,7 @@ revs = scmutil.revrange(repo, pushedrevs) nodes = [repo[r].node() for r in revs] common, any, hds = setdiscovery.findcommonheads( - ui, repo, remote, ancestorsof=nodes + ui, repo, remote, ancestorsof=nodes, audit=data ) return common, hds @@ -1042,7 +1043,6 @@ common_initial_undecided = initial_undecided & common missing_initial_undecided = initial_undecided & missing - data = {} data[b'elapsed'] = t.elapsed data[b'nb-common-heads'] = len(heads_common) data[b'nb-common-heads-local'] = len(heads_common_local) @@ -1068,6 +1068,7 @@ # display discovery summary ui.writenoi18n(b"elapsed time: %(elapsed)f seconds\n" % data) + ui.writenoi18n(b"round-trips: %(total-roundtrips)9d\n" % data) ui.writenoi18n(b"heads summary:\n") ui.writenoi18n(b" total common heads: %(nb-common-heads)9d\n" % data) ui.writenoi18n(