comparison mercurial/commands.py @ 48240:607e9322fc89

path: return path instance directly from get_pull_paths This means the caller has to do a bit more work, however it give access to the `path` instance and the information it contains. Differential Revision: https://phab.mercurial-scm.org/D11673
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 15 Oct 2021 02:44:14 +0200
parents 5105a9975407
children 7d1e60244561
comparison
equal deleted inserted replaced
48239:08630dd719f9 48240:607e9322fc89
4344 return 0 4344 return 0
4345 4345
4346 cmdutil.check_incompatible_arguments(opts, b'subrepos', [b'bundle']) 4346 cmdutil.check_incompatible_arguments(opts, b'subrepos', [b'bundle'])
4347 4347
4348 if opts.get(b'bookmarks'): 4348 if opts.get(b'bookmarks'):
4349 srcs = urlutil.get_pull_paths(repo, ui, [source], opts.get(b'branch')) 4349 srcs = urlutil.get_pull_paths(repo, ui, [source])
4350 for source, branches in srcs: 4350 for path in srcs:
4351 source, branches = urlutil.parseurl(
4352 path.rawloc, opts.get(b'branch')
4353 )
4351 other = hg.peer(repo, opts, source) 4354 other = hg.peer(repo, opts, source)
4352 try: 4355 try:
4353 if b'bookmarks' not in other.listkeys(b'namespaces'): 4356 if b'bookmarks' not in other.listkeys(b'namespaces'):
4354 ui.warn(_(b"remote doesn't support bookmarks\n")) 4357 ui.warn(_(b"remote doesn't support bookmarks\n"))
4355 return 0 4358 return 0
5391 ): 5394 ):
5392 msg = _(b'update destination required by configuration') 5395 msg = _(b'update destination required by configuration')
5393 hint = _(b'use hg pull followed by hg update DEST') 5396 hint = _(b'use hg pull followed by hg update DEST')
5394 raise error.InputError(msg, hint=hint) 5397 raise error.InputError(msg, hint=hint)
5395 5398
5396 sources = urlutil.get_pull_paths(repo, ui, sources, opts.get(b'branch')) 5399 for path in urlutil.get_pull_paths(repo, ui, sources):
5397 for source, branches in sources: 5400 source, branches = urlutil.parseurl(path.rawloc, opts.get(b'branch'))
5398 ui.status(_(b'pulling from %s\n') % urlutil.hidepassword(source)) 5401 ui.status(_(b'pulling from %s\n') % urlutil.hidepassword(source))
5399 ui.flush() 5402 ui.flush()
5400 other = hg.peer(repo, opts, source) 5403 other = hg.peer(repo, opts, source)
5401 update_conflict = None 5404 update_conflict = None
5402 try: 5405 try: