comparison mercurial/utils/urlutil.py @ 46916:7061eee84151

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
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 13 Apr 2021 15:32:59 +0200
parents df7439cc6806
children efadec3ea8e2
comparison
equal deleted inserted replaced
46915:efc6f6a794bd 46916:7061eee84151
446 446
447 447
448 def get_push_paths(repo, ui, dests): 448 def get_push_paths(repo, ui, dests):
449 """yields all the `path` selected as push destination by `dests`""" 449 """yields all the `path` selected as push destination by `dests`"""
450 if not dests: 450 if not dests:
451 dests = [None] 451 if b'default-push' in ui.paths:
452 for dest in dests: 452 yield ui.paths[b'default-push']
453 yield ui.getpath(dest, default=(b'default-push', b'default')) 453 elif b'default' in ui.paths:
454 yield ui.paths[b'default']
455 else:
456 yield None
457 else:
458 for dest in dests:
459 yield ui.getpath(dest)
454 460
455 461
456 def get_pull_paths(repo, ui, sources, default_branches=()): 462 def get_pull_paths(repo, ui, sources, default_branches=()):
457 """yields all the `(path, branch)` selected as pull source by `sources`""" 463 """yields all the `(path, branch)` selected as pull source by `sources`"""
458 if not sources: 464 if not sources: