# HG changeset patch # User Pierre-Yves David # Date 2022-12-02 05:52:27 # Node ID 4cedae992ed10d764e83a4a54721433c5c51d0f9 # Parent a804242050c488278d93663c3f654f5a7b3cb8ae path: pass `path` to `peer` in `hg perf::discovery` We directly use the `path` object to build the `peer` object. diff --git a/contrib/perf.py b/contrib/perf.py --- a/contrib/perf.py +++ b/contrib/perf.py @@ -997,11 +997,16 @@ def perfdiscovery(ui, repo, path, **opts timer, fm = gettimer(ui, opts) try: - from mercurial.utils.urlutil import get_unique_pull_path - - path = get_unique_pull_path(b'perfdiscovery', repo, ui, path)[0] + from mercurial.utils.urlutil import get_unique_pull_path_obj + + path = get_unique_pull_path_obj(b'perfdiscovery', ui, path) except ImportError: - path = ui.expandpath(path) + try: + from mercurial.utils.urlutil import get_unique_pull_path + + path = get_unique_pull_path(b'perfdiscovery', repo, ui, path)[0] + except ImportError: + path = ui.expandpath(path) def s(): repos[1] = hg.peer(ui, opts, path)