# HG changeset patch # User Pierre-Yves David # Date 1669916519 -3600 # Node ID 06083c5f9e2952ad9493f6b7af438edd695dbcc4 # Parent e64b1e9f4892ee4fd612201f94b570ad20730b4f path: pass `path` to `peer` in `hg pull` We directly use the `path` object to build the `peer` object. We don't use it for sub-repositories yet, which will have to be fixed at some point. diff -r e64b1e9f4892 -r 06083c5f9e29 mercurial/commands.py --- a/mercurial/commands.py Thu Dec 01 18:19:08 2022 +0100 +++ b/mercurial/commands.py Thu Dec 01 18:41:59 2022 +0100 @@ -5431,12 +5431,12 @@ raise error.InputError(msg, hint=hint) 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.status(_(b'pulling from %s\n') % urlutil.hidepassword(path.loc)) ui.flush() - other = hg.peer(repo, opts, source) + other = hg.peer(repo, opts, path) update_conflict = None try: + branches = (path.branch, opts.get(b'branch', [])) revs, checkout = hg.addbranchrevs( repo, other, branches, opts.get(b'rev') ) @@ -5512,8 +5512,12 @@ elif opts.get(b'branch'): brev = opts[b'branch'][0] else: - brev = branches[0] - repo._subtoppath = source + brev = path.branch + + # XXX path: we are losing the `path` object here. Keeping it + # would be valuable. For example as a "variant" as we do + # for pushes. + repo._subtoppath = path.loc try: update_conflict = postincoming( ui, repo, modheads, opts.get(b'update'), checkout, brev