comparison mercurial/commands.py @ 49831:06083c5f9e29

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.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 01 Dec 2022 18:41:59 +0100
parents f2f4ec857f78
children 970491e630a5
comparison
equal deleted inserted replaced
49830:e64b1e9f4892 49831:06083c5f9e29
5429 msg = _(b'update destination required by configuration') 5429 msg = _(b'update destination required by configuration')
5430 hint = _(b'use hg pull followed by hg update DEST') 5430 hint = _(b'use hg pull followed by hg update DEST')
5431 raise error.InputError(msg, hint=hint) 5431 raise error.InputError(msg, hint=hint)
5432 5432
5433 for path in urlutil.get_pull_paths(repo, ui, sources): 5433 for path in urlutil.get_pull_paths(repo, ui, sources):
5434 source, branches = urlutil.parseurl(path.rawloc, opts.get(b'branch')) 5434 ui.status(_(b'pulling from %s\n') % urlutil.hidepassword(path.loc))
5435 ui.status(_(b'pulling from %s\n') % urlutil.hidepassword(source))
5436 ui.flush() 5435 ui.flush()
5437 other = hg.peer(repo, opts, source) 5436 other = hg.peer(repo, opts, path)
5438 update_conflict = None 5437 update_conflict = None
5439 try: 5438 try:
5439 branches = (path.branch, opts.get(b'branch', []))
5440 revs, checkout = hg.addbranchrevs( 5440 revs, checkout = hg.addbranchrevs(
5441 repo, other, branches, opts.get(b'rev') 5441 repo, other, branches, opts.get(b'rev')
5442 ) 5442 )
5443 5443
5444 pullopargs = {} 5444 pullopargs = {}
5510 if opts.get(b'rev'): 5510 if opts.get(b'rev'):
5511 brev = opts[b'rev'][0] 5511 brev = opts[b'rev'][0]
5512 elif opts.get(b'branch'): 5512 elif opts.get(b'branch'):
5513 brev = opts[b'branch'][0] 5513 brev = opts[b'branch'][0]
5514 else: 5514 else:
5515 brev = branches[0] 5515 brev = path.branch
5516 repo._subtoppath = source 5516
5517 # XXX path: we are losing the `path` object here. Keeping it
5518 # would be valuable. For example as a "variant" as we do
5519 # for pushes.
5520 repo._subtoppath = path.loc
5517 try: 5521 try:
5518 update_conflict = postincoming( 5522 update_conflict = postincoming(
5519 ui, repo, modheads, opts.get(b'update'), checkout, brev 5523 ui, repo, modheads, opts.get(b'update'), checkout, brev
5520 ) 5524 )
5521 except error.FilteredRepoLookupError as exc: 5525 except error.FilteredRepoLookupError as exc: