Show More
@@ -530,9 +530,25 b' def get_unique_pull_path(action, repo, u' | |||||
530 |
|
530 | |||
531 | def get_clone_path(ui, source, default_branches=()): |
|
531 | def get_clone_path(ui, source, default_branches=()): | |
532 | """return the `(origsource, path, branch)` selected as clone source""" |
|
532 | """return the `(origsource, path, branch)` selected as clone source""" | |
533 | url = ui.expandpath(source) |
|
533 | if source is None: | |
534 | path, branch = parseurl(url, default_branches) |
|
534 | if b'default' in ui.paths: | |
535 | return url, path, branch |
|
535 | url = ui.paths[b'default'].rawloc | |
|
536 | else: | |||
|
537 | # XXX this is the historical default behavior, but that is not | |||
|
538 | # great, consider breaking BC on this. | |||
|
539 | url = b'default' | |||
|
540 | else: | |||
|
541 | if source in ui.paths: | |||
|
542 | url = ui.paths[source].rawloc | |||
|
543 | else: | |||
|
544 | # Try to resolve as a local path or URI. | |||
|
545 | try: | |||
|
546 | # we pass the ui instance are warning might need to be issued | |||
|
547 | url = path(ui, None, rawloc=source).rawloc | |||
|
548 | except ValueError: | |||
|
549 | url = source | |||
|
550 | clone_path, branch = parseurl(url, default_branches) | |||
|
551 | return url, clone_path, branch | |||
536 |
|
552 | |||
537 |
|
553 | |||
538 | def parseurl(path, branches=None): |
|
554 | def parseurl(path, branches=None): |
General Comments 0
You need to be logged in to leave comments.
Login now