Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/utils/urlutil.py @ 47069:d69a9628eba7
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
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Thu, 15 Apr 2021 10:01:44 +0200 |
parents | c029b35565dd |
children | 9ea75ea23534 |
comparison
equal
deleted
inserted
replaced
47068:c029b35565dd | 47069:d69a9628eba7 |
---|---|
469 _(b'default repository not configured!'), | 469 _(b'default repository not configured!'), |
470 hint=_(b"see 'hg help config.paths'"), | 470 hint=_(b"see 'hg help config.paths'"), |
471 ) | 471 ) |
472 else: | 472 else: |
473 for dest in dests: | 473 for dest in dests: |
474 yield ui.getpath(dest) | 474 if dest in ui.paths: |
475 yield ui.paths[dest] | |
476 else: | |
477 path = try_path(ui, dest) | |
478 if path is None: | |
479 msg = _(b'repository %s does not exist') | |
480 msg %= dest | |
481 raise error.RepoError(msg) | |
482 yield path | |
475 | 483 |
476 | 484 |
477 def get_pull_paths(repo, ui, sources, default_branches=()): | 485 def get_pull_paths(repo, ui, sources, default_branches=()): |
478 """yields all the `(path, branch)` selected as pull source by `sources`""" | 486 """yields all the `(path, branch)` selected as pull source by `sources`""" |
479 if not sources: | 487 if not sources: |