# HG changeset patch # User Pierre-Yves David # Date 2021-04-14 19:20:58 # Node ID afdd7c472ef2188035b2354d710373b2ae8cd1da # Parent d7b36a4e03dec3a946ca8c1a0f6d4de96826cbc1 urlutil: remove usage of `ui.expandpath` in `get_pull_paths` We want to deprecate `ui.expandpath` and simplify the code before adding more complexity in the form of `[paths]` entry pointing to multiple url. So we inline the relevant bits. Differential Revision: https://phab.mercurial-scm.org/D10429 diff --git a/mercurial/utils/urlutil.py b/mercurial/utils/urlutil.py --- a/mercurial/utils/urlutil.py +++ b/mercurial/utils/urlutil.py @@ -467,7 +467,15 @@ def get_pull_paths(repo, ui, sources, de if not sources: sources = [b'default'] for source in sources: - url = ui.expandpath(source) + if source in ui.paths: + url = ui.paths[source].rawloc + else: + # Try to resolve as a local path or URI. + try: + # we pass the ui instance are warning might need to be issued + url = path(ui, None, rawloc=source).rawloc + except ValueError: + url = source yield parseurl(url, default_branches)