urlutil: inline the relevant part of `getpath` in `get_push_paths`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 15 Apr 2021 10:01:44 +0200
changeset 47028 d69a9628eba7
parent 47027 c029b35565dd
child 47029 9ea75ea23534
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
mercurial/utils/urlutil.py
--- a/mercurial/utils/urlutil.py	Thu Apr 15 09:50:56 2021 +0200
+++ b/mercurial/utils/urlutil.py	Thu Apr 15 10:01:44 2021 +0200
@@ -471,7 +471,15 @@
             )
     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=()):