Patchwork D10436: perfphasesremote: use `get_unique_push_path` if available

login
register
mail settings
Submitter phabricator
Date April 15, 2021, 8:53 a.m.
Message ID <differential-rev-PHID-DREV-a6aiqtuqiuznyadurxhv-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48755/
State Superseded
Headers show

Comments

phabricator - April 15, 2021, 8:53 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  After `ui.expandpath` we are not after `getpath` (that will be much simpler). The reason is still the fact we can't rely on getting a single url from a single path anymore.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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
@@ -1414,7 +1414,13 @@ 
     opts = _byteskwargs(opts)
     timer, fm = gettimer(ui, opts)
 
-    path = ui.getpath(dest, default=(b'default-push', b'default'))
+    try:
+        from mercurial.utils.urlutil import get_unique_push_path
+
+        path = get_unique_push_path(repo, ui, dest)
+    except ImportError:
+        path = ui.getpath(dest, default=(b'default-push', b'default'))
+
     if not path:
         raise error.Abort(
             b'default repository not configured!',