Mercurial > hg
comparison contrib/perf.py @ 46973:92029a43debb
perf-discovery: use `get_unique_pull_path`
This performance command now use the new API, unless the benchmarked Mercurial
is older.
Differential Revision: https://phab.mercurial-scm.org/D10423
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 14 Apr 2021 20:32:53 +0200 |
parents | 6266d19556ad |
children | 3c9208702db3 |
comparison
equal
deleted
inserted
replaced
46972:6904a9f33b30 | 46973:92029a43debb |
---|---|
913 @command(b'perf::discovery|perfdiscovery', formatteropts, b'PATH') | 913 @command(b'perf::discovery|perfdiscovery', formatteropts, b'PATH') |
914 def perfdiscovery(ui, repo, path, **opts): | 914 def perfdiscovery(ui, repo, path, **opts): |
915 """benchmark discovery between local repo and the peer at given path""" | 915 """benchmark discovery between local repo and the peer at given path""" |
916 repos = [repo, None] | 916 repos = [repo, None] |
917 timer, fm = gettimer(ui, opts) | 917 timer, fm = gettimer(ui, opts) |
918 path = ui.expandpath(path) | 918 |
919 try: | |
920 from mercurial.utils.urlutil import get_unique_pull_path | |
921 | |
922 path = get_unique_pull_path(b'perfdiscovery', repo, ui, path)[0] | |
923 except ImportError: | |
924 path = ui.expandpath(path) | |
919 | 925 |
920 def s(): | 926 def s(): |
921 repos[1] = hg.peer(ui, opts, path) | 927 repos[1] = hg.peer(ui, opts, path) |
922 | 928 |
923 def d(): | 929 def d(): |