From patchwork Wed Apr 14 23:41:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D10423: perf-discovery: use `get_unique_pull_path` From: phabricator X-Patchwork-Id: 48741 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 14 Apr 2021 23:41:03 +0000 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 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)