469 for source in sources: |
469 for source in sources: |
470 url = ui.expandpath(source) |
470 url = ui.expandpath(source) |
471 yield parseurl(url, default_branches) |
471 yield parseurl(url, default_branches) |
472 |
472 |
473 |
473 |
|
474 def get_unique_pull_path(action, repo, ui, source=None, default_branches=()): |
|
475 """return a unique `(path, branch)` or abort if multiple are found |
|
476 |
|
477 This is useful for command and action that does not support multiple |
|
478 destination (yet). |
|
479 |
|
480 Note that for now, we cannot get multiple destination so this function is "trivial". |
|
481 |
|
482 The `action` parameter will be used for the error message. |
|
483 """ |
|
484 if source is None: |
|
485 source = b'default' |
|
486 url = ui.expandpath(source) |
|
487 return parseurl(url, default_branches) |
|
488 |
|
489 |
474 def get_clone_path(ui, source, default_branches=()): |
490 def get_clone_path(ui, source, default_branches=()): |
475 """return the `(origsource, path, branch)` selected as clone source""" |
491 """return the `(origsource, path, branch)` selected as clone source""" |
476 url = ui.expandpath(source) |
492 url = ui.expandpath(source) |
477 path, branch = parseurl(url, default_branches) |
493 path, branch = parseurl(url, default_branches) |
478 return url, path, branch |
494 return url, path, branch |