Patchwork D10423: perf-discovery: use `get_unique_pull_path`

login
register
mail settings
Submitter phabricator
Date April 14, 2021, 11:41 p.m.
Message ID <differential-rev-PHID-DREV-ss3jpalhwwx4nqm7k7sc-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48741/
State Superseded
Headers show

Comments

phabricator - April 14, 2021, 11:41 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  This performance command now use the new API, unless the benchmarked Mercurial
  is older.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10423

AFFECTED FILES
  contrib/perf.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/contrib/perf.py b/contrib/perf.py
--- a/contrib/perf.py
+++ b/contrib/perf.py
@@ -915,7 +915,14 @@ 
     """benchmark discovery between local repo and the peer at given path"""
     repos = [repo, None]
     timer, fm = gettimer(ui, opts)
-    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:
+        raise
+        path = ui.expandpath(path)
 
     def s():
         repos[1] = hg.peer(ui, opts, path)