# HG changeset patch # User Pierre-Yves David # Date 2021-04-13 13:32:59 # Node ID 7061eee84151b4c7118c5b435840dab1bd305bc5 # Parent efc6f6a794bd4b3529cec4a29c4cd7cb997e094d push-dests: rework the handling of default value This new core is more straightforward and doing this early will make the next changeset simpler. Differential Revision: https://phab.mercurial-scm.org/D10384 diff --git a/mercurial/utils/urlutil.py b/mercurial/utils/urlutil.py --- a/mercurial/utils/urlutil.py +++ b/mercurial/utils/urlutil.py @@ -448,9 +448,15 @@ def removeauth(u): def get_push_paths(repo, ui, dests): """yields all the `path` selected as push destination by `dests`""" if not dests: - dests = [None] - for dest in dests: - yield ui.getpath(dest, default=(b'default-push', b'default')) + if b'default-push' in ui.paths: + yield ui.paths[b'default-push'] + elif b'default' in ui.paths: + yield ui.paths[b'default'] + else: + yield None + else: + for dest in dests: + yield ui.getpath(dest) def get_pull_paths(repo, ui, sources, default_branches=()):