diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4311,19 +4311,20 @@ cmdutil.check_incompatible_arguments(opts, b'subrepos', [b'bundle']) if opts.get(b'bookmarks'): - source, branches = urlutil.parseurl( - ui.expandpath(source), opts.get(b'branch') - ) - other = hg.peer(repo, opts, source) - try: - if b'bookmarks' not in other.listkeys(b'namespaces'): - ui.warn(_(b"remote doesn't support bookmarks\n")) - return 0 - ui.pager(b'incoming') - ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(source)) - return bookmarks.incoming(ui, repo, other) - finally: - other.close() + srcs = urlutil.get_pull_paths(repo, ui, [source], opts.get(b'branch')) + for source, branches in srcs: + other = hg.peer(repo, opts, source) + try: + if b'bookmarks' not in other.listkeys(b'namespaces'): + ui.warn(_(b"remote doesn't support bookmarks\n")) + return 0 + ui.pager(b'incoming') + ui.status( + _(b'comparing with %s\n') % urlutil.hidepassword(source) + ) + return bookmarks.incoming(ui, repo, other) + finally: + other.close() repo._subtoppath = ui.expandpath(source) try: diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -1263,9 +1263,13 @@ (remoterepo, incomingchangesetlist, displayer) parameters, and is supposed to contain only code that can't be unified. """ - source, branches = urlutil.parseurl( - ui.expandpath(source), opts.get(b'branch') - ) + srcs = urlutil.get_pull_paths(repo, ui, [source], opts.get(b'branch')) + srcs = list(srcs) + if len(srcs) != 1: + msg = _('for now, incoming supports only a single source, %d provided') + msg %= len(srcs) + raise error.Abort(msg) + source, branches = srcs[0] other = peer(repo, opts, source) cleanupfn = other.close try: