507 Note that for now, we cannot get multiple destination so this function is "trivial". |
507 Note that for now, we cannot get multiple destination so this function is "trivial". |
508 |
508 |
509 The `action` parameter will be used for the error message. |
509 The `action` parameter will be used for the error message. |
510 """ |
510 """ |
511 if source is None: |
511 if source is None: |
512 source = b'default' |
512 if b'default' in ui.paths: |
513 url = ui.expandpath(source) |
513 url = ui.paths[b'default'].rawloc |
|
514 else: |
|
515 # XXX this is the historical default behavior, but that is not |
|
516 # great, consider breaking BC on this. |
|
517 url = b'default' |
|
518 else: |
|
519 if source in ui.paths: |
|
520 url = ui.paths[source].rawloc |
|
521 else: |
|
522 # Try to resolve as a local path or URI. |
|
523 try: |
|
524 # we pass the ui instance are warning might need to be issued |
|
525 url = path(ui, None, rawloc=source).rawloc |
|
526 except ValueError: |
|
527 url = source |
514 return parseurl(url, default_branches) |
528 return parseurl(url, default_branches) |
515 |
529 |
516 |
530 |
517 def get_clone_path(ui, source, default_branches=()): |
531 def get_clone_path(ui, source, default_branches=()): |
518 """return the `(origsource, path, branch)` selected as clone source""" |
532 """return the `(origsource, path, branch)` selected as clone source""" |