# HG changeset patch # User Pierre-Yves David # Date 2021-04-15 08:01:44 # Node ID fb7bee1ebc03cd7211f43fc05f609e93088d655d # Parent fd396eb21feaadd088dc53abb96d8a40de768c11 urlutil: inline the relevant part of `getpath` in `get_push_paths` The part that `get_push_paths` needs is quite simple, inclining will help us to deprecated `getpath`. Differential Revision: https://phab.mercurial-scm.org/D10438 diff --git a/mercurial/utils/urlutil.py b/mercurial/utils/urlutil.py --- a/mercurial/utils/urlutil.py +++ b/mercurial/utils/urlutil.py @@ -471,7 +471,15 @@ def get_push_paths(repo, ui, dests): ) else: for dest in dests: - yield ui.getpath(dest) + if dest in ui.paths: + yield ui.paths[dest] + else: + path = try_path(ui, dest) + if path is None: + msg = _(b'repository %s does not exist') + msg %= dest + raise error.RepoError(msg) + yield path def get_pull_paths(repo, ui, sources, default_branches=()):