path: pass `path` to `peer` in `hg perf::discovery`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 02 Dec 2022 06:52:27 +0100
changeset 49849 4cedae992ed1
parent 49848 a804242050c4
child 49850 afcf59039b5d
path: pass `path` to `peer` in `hg perf::discovery` We directly use the `path` object to build the `peer` object.
contrib/perf.py
--- a/contrib/perf.py	Fri Dec 02 06:49:39 2022 +0100
+++ b/contrib/perf.py	Fri Dec 02 06:52:27 2022 +0100
@@ -997,11 +997,16 @@
     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)