478 def get_push_paths(repo, ui, dests): |
478 def get_push_paths(repo, ui, dests): |
479 """yields all the `path` selected as push destination by `dests`""" |
479 """yields all the `path` selected as push destination by `dests`""" |
480 if not dests: |
480 if not dests: |
481 if b'default-push' in ui.paths: |
481 if b'default-push' in ui.paths: |
482 for p in ui.paths[b'default-push']: |
482 for p in ui.paths[b'default-push']: |
483 yield p |
483 yield p.get_push_variant() |
484 elif b'default' in ui.paths: |
484 elif b'default' in ui.paths: |
485 for p in ui.paths[b'default']: |
485 for p in ui.paths[b'default']: |
486 yield p |
486 yield p.get_push_variant() |
487 else: |
487 else: |
488 raise error.ConfigError( |
488 raise error.ConfigError( |
489 _(b'default repository not configured!'), |
489 _(b'default repository not configured!'), |
490 hint=_(b"see 'hg help config.paths'"), |
490 hint=_(b"see 'hg help config.paths'"), |
491 ) |
491 ) |
492 else: |
492 else: |
493 for dest in dests: |
493 for dest in dests: |
494 if dest in ui.paths: |
494 if dest in ui.paths: |
495 for p in ui.paths[dest]: |
495 for p in ui.paths[dest]: |
496 yield p |
496 yield p.get_push_variant() |
497 else: |
497 else: |
498 path = try_path(ui, dest) |
498 path = try_path(ui, dest) |
499 if path is None: |
499 if path is None: |
500 msg = _(b'repository %s does not exist') |
500 msg = _(b'repository %s does not exist') |
501 msg %= dest |
501 msg %= dest |
502 raise error.RepoError(msg) |
502 raise error.RepoError(msg) |
503 yield path |
503 yield path.get_push_variant() |
504 |
504 |
505 |
505 |
506 def get_pull_paths(repo, ui, sources): |
506 def get_pull_paths(repo, ui, sources): |
507 """yields all the `(path, branch)` selected as pull source by `sources`""" |
507 """yields all the `(path, branch)` selected as pull source by `sources`""" |
508 if not sources: |
508 if not sources: |