diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4346,8 +4346,11 @@ cmdutil.check_incompatible_arguments(opts, b'subrepos', [b'bundle']) if opts.get(b'bookmarks'): - srcs = urlutil.get_pull_paths(repo, ui, [source], opts.get(b'branch')) - for source, branches in srcs: + srcs = urlutil.get_pull_paths(repo, ui, [source]) + for path in srcs: + source, branches = urlutil.parseurl( + path.rawloc, opts.get(b'branch') + ) other = hg.peer(repo, opts, source) try: if b'bookmarks' not in other.listkeys(b'namespaces'): @@ -5393,8 +5396,8 @@ hint = _(b'use hg pull followed by hg update DEST') raise error.InputError(msg, hint=hint) - sources = urlutil.get_pull_paths(repo, ui, sources, opts.get(b'branch')) - for source, branches in sources: + for path in urlutil.get_pull_paths(repo, ui, sources): + source, branches = urlutil.parseurl(path.rawloc, opts.get(b'branch')) ui.status(_(b'pulling from %s\n') % urlutil.hidepassword(source)) ui.flush() other = hg.peer(repo, opts, source) diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -1261,13 +1261,14 @@ (remoterepo, incomingchangesetlist, displayer) parameters, and is supposed to contain only code that can't be unified. """ - srcs = urlutil.get_pull_paths(repo, ui, [source], opts.get(b'branch')) + srcs = urlutil.get_pull_paths(repo, ui, [source]) srcs = list(srcs) if len(srcs) != 1: msg = _(b'for now, incoming supports only a single source, %d provided') msg %= len(srcs) raise error.Abort(msg) - source, branches = srcs[0] + path = srcs[0] + source, branches = urlutil.parseurl(path.rawloc, opts.get(b'branch')) if subpath is not None: subpath = urlutil.url(subpath) if subpath.isabs(): diff --git a/mercurial/utils/urlutil.py b/mercurial/utils/urlutil.py --- a/mercurial/utils/urlutil.py +++ b/mercurial/utils/urlutil.py @@ -503,17 +503,17 @@ yield path -def get_pull_paths(repo, ui, sources, default_branches=()): +def get_pull_paths(repo, ui, sources): """yields all the `(path, branch)` selected as pull source by `sources`""" if not sources: sources = [b'default'] for source in sources: if source in ui.paths: for p in ui.paths[source]: - yield parseurl(p.rawloc, default_branches) + yield p else: p = path(ui, None, source, validate_path=False) - yield parseurl(p.rawloc, default_branches) + yield p def get_unique_push_path(action, repo, ui, dest=None):