Mercurial > public > mercurial-scm > hg
comparison mercurial/commands.py @ 46932:dec31caf5fd6
incoming: use `urlutil.get_pull_paths`
Lets use the new method to increase code reuse. However I did not implement
support for multiple source yet. It would be possible create multiple temporary
bundle, but that is a bit too much work outside of my current route to make the
detour.
Differential Revision: https://phab.mercurial-scm.org/D10392
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 14 Apr 2021 02:14:15 +0200 |
parents | d4e4ccb75f99 |
children | 946db89607c8 |
comparison
equal
deleted
inserted
replaced
46931:d4e4ccb75f99 | 46932:dec31caf5fd6 |
---|---|
4309 return 0 | 4309 return 0 |
4310 | 4310 |
4311 cmdutil.check_incompatible_arguments(opts, b'subrepos', [b'bundle']) | 4311 cmdutil.check_incompatible_arguments(opts, b'subrepos', [b'bundle']) |
4312 | 4312 |
4313 if opts.get(b'bookmarks'): | 4313 if opts.get(b'bookmarks'): |
4314 source, branches = urlutil.parseurl( | 4314 srcs = urlutil.get_pull_paths(repo, ui, [source], opts.get(b'branch')) |
4315 ui.expandpath(source), opts.get(b'branch') | 4315 for source, branches in srcs: |
4316 ) | 4316 other = hg.peer(repo, opts, source) |
4317 other = hg.peer(repo, opts, source) | 4317 try: |
4318 try: | 4318 if b'bookmarks' not in other.listkeys(b'namespaces'): |
4319 if b'bookmarks' not in other.listkeys(b'namespaces'): | 4319 ui.warn(_(b"remote doesn't support bookmarks\n")) |
4320 ui.warn(_(b"remote doesn't support bookmarks\n")) | 4320 return 0 |
4321 return 0 | 4321 ui.pager(b'incoming') |
4322 ui.pager(b'incoming') | 4322 ui.status( |
4323 ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(source)) | 4323 _(b'comparing with %s\n') % urlutil.hidepassword(source) |
4324 return bookmarks.incoming(ui, repo, other) | 4324 ) |
4325 finally: | 4325 return bookmarks.incoming(ui, repo, other) |
4326 other.close() | 4326 finally: |
4327 other.close() | |
4327 | 4328 |
4328 repo._subtoppath = ui.expandpath(source) | 4329 repo._subtoppath = ui.expandpath(source) |
4329 try: | 4330 try: |
4330 return hg.incoming(ui, repo, source, opts) | 4331 return hg.incoming(ui, repo, source, opts) |
4331 finally: | 4332 finally: |