contrib/perf.py
changeset 49849 4cedae992ed1
parent 49817 ec8140c44b14
child 50064 e859f440daa9
--- 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)