Show More
@@ -445,6 +445,18 b' def removeauth(u):' | |||
|
445 | 445 | return bytes(u) |
|
446 | 446 | |
|
447 | 447 | |
|
448 | def try_path(ui, url): | |
|
449 | """try to build a path from a url | |
|
450 | ||
|
451 | Return None if no Path could built. | |
|
452 | """ | |
|
453 | try: | |
|
454 | # we pass the ui instance are warning might need to be issued | |
|
455 | return path(ui, None, rawloc=url) | |
|
456 | except ValueError: | |
|
457 | return None | |
|
458 | ||
|
459 | ||
|
448 | 460 | def get_push_paths(repo, ui, dests): |
|
449 | 461 | """yields all the `path` selected as push destination by `dests`""" |
|
450 | 462 | if not dests: |
@@ -471,10 +483,10 b' def get_pull_paths(repo, ui, sources, de' | |||
|
471 | 483 | url = ui.paths[source].rawloc |
|
472 | 484 | else: |
|
473 | 485 | # Try to resolve as a local path or URI. |
|
474 | try: | |
|
475 | # we pass the ui instance are warning might need to be issued | |
|
476 |
url = path |
|
|
477 |
e |
|
|
486 | path = try_path(ui, source) | |
|
487 | if path is not None: | |
|
488 | url = path.rawloc | |
|
489 | else: | |
|
478 | 490 | url = source |
|
479 | 491 | yield parseurl(url, default_branches) |
|
480 | 492 | |
@@ -520,10 +532,10 b' def get_unique_pull_path(action, repo, u' | |||
|
520 | 532 | url = ui.paths[source].rawloc |
|
521 | 533 | else: |
|
522 | 534 | # 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 |
|
|
526 |
e |
|
|
535 | path = try_path(ui, source) | |
|
536 | if path is not None: | |
|
537 | url = path.rawloc | |
|
538 | else: | |
|
527 | 539 | url = source |
|
528 | 540 | return parseurl(url, default_branches) |
|
529 | 541 | |
@@ -542,10 +554,10 b' def get_clone_path(ui, source, default_b' | |||
|
542 | 554 | url = ui.paths[source].rawloc |
|
543 | 555 | else: |
|
544 | 556 | # 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 |
|
|
548 |
e |
|
|
557 | path = try_path(ui, source) | |
|
558 | if path is not None: | |
|
559 | url = path.rawloc | |
|
560 | else: | |
|
549 | 561 | url = source |
|
550 | 562 | clone_path, branch = parseurl(url, default_branches) |
|
551 | 563 | return url, clone_path, branch |
@@ -607,16 +619,14 b' class paths(dict):' | |||
|
607 | 619 | # This may need to raise in the future. |
|
608 | 620 | if not name: |
|
609 | 621 | return None |
|
610 | ||
|
611 | try: | |
|
622 | if name in self: | |
|
612 | 623 | return self[name] |
|
613 | except KeyError: | |
|
624 | else: | |
|
614 | 625 | # Try to resolve as a local path or URI. |
|
615 | try: | |
|
616 | # we pass the ui instance are warning might need to be issued | |
|
617 | return path(ui, None, rawloc=name) | |
|
618 | except ValueError: | |
|
626 | path = try_path(ui, name) | |
|
627 | if path is None: | |
|
619 | 628 | raise error.RepoError(_(b'repository %s does not exist') % name) |
|
629 | return path.rawloc | |
|
620 | 630 | |
|
621 | 631 | |
|
622 | 632 | _pathsuboptions = {} |
General Comments 0
You need to be logged in to leave comments.
Login now