Changeset View
Changeset View
Standalone View
Standalone View
mercurial/utils/urlutil.py
Show First 20 Lines • Show All 461 Lines • ▼ Show 20 Line(s) | else: | ||||
yield ui.getpath(dest) | yield ui.getpath(dest) | ||||
def get_pull_paths(repo, ui, sources, default_branches=()): | def get_pull_paths(repo, ui, sources, default_branches=()): | ||||
"""yields all the `(path, branch)` selected as pull source by `sources`""" | """yields all the `(path, branch)` selected as pull source by `sources`""" | ||||
if not sources: | if not sources: | ||||
sources = [b'default'] | sources = [b'default'] | ||||
for source in sources: | for source in sources: | ||||
url = ui.expandpath(source) | if source in ui.paths: | ||||
url = ui.paths[source].rawloc | |||||
else: | |||||
# Try to resolve as a local path or URI. | |||||
try: | |||||
# we pass the ui instance are warning might need to be issued | |||||
url = path(ui, None, rawloc=source).rawloc | |||||
except ValueError: | |||||
url = source | |||||
yield parseurl(url, default_branches) | yield parseurl(url, default_branches) | ||||
def get_unique_push_path(action, repo, ui, dest=None): | def get_unique_push_path(action, repo, ui, dest=None): | ||||
"""return a unique `path` or abort if multiple are found | """return a unique `path` or abort if multiple are found | ||||
This is useful for command and action that does not support multiple | This is useful for command and action that does not support multiple | ||||
destination (yet). | destination (yet). | ||||
▲ Show 20 Lines • Show All 276 Lines • Show Last 20 Lines |