path: have `get_push_paths` directly return the push variants
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 01 Dec 2022 01:33:27 +0100
changeset 49697 1fae401b3b14
parent 49696 0acefbbcc82a
child 49698 c9690836747d
path: have `get_push_paths` directly return the push variants So the function directly returns usable paths, that should help the callers!
mercurial/utils/urlutil.py
--- a/mercurial/utils/urlutil.py	Thu Dec 01 01:32:24 2022 +0100
+++ b/mercurial/utils/urlutil.py	Thu Dec 01 01:33:27 2022 +0100
@@ -480,10 +480,10 @@
     if not dests:
         if b'default-push' in ui.paths:
             for p in ui.paths[b'default-push']:
-                yield p
+                yield p.get_push_variant()
         elif b'default' in ui.paths:
             for p in ui.paths[b'default']:
-                yield p
+                yield p.get_push_variant()
         else:
             raise error.ConfigError(
                 _(b'default repository not configured!'),
@@ -493,14 +493,14 @@
         for dest in dests:
             if dest in ui.paths:
                 for p in ui.paths[dest]:
-                    yield p
+                    yield p.get_push_variant()
             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
+                yield path.get_push_variant()
 
 
 def get_pull_paths(repo, ui, sources):