comparison mercurial/commands.py @ 46910:df7439cc6806

urlutil: add a `get_pull_paths` to perform the pull destination logic As is this changeset does not change anything. However having an official empty point will help unifying the logic and encapsulate the details and update the logic to support path definition pointing to multiple other path. Differential Revision: https://phab.mercurial-scm.org/D10378
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 13 Apr 2021 12:28:44 +0200
parents 067840864f37
children efc6f6a794bd
comparison
equal deleted inserted replaced
46909:067840864f37 46910:df7439cc6806
5385 ): 5385 ):
5386 msg = _(b'update destination required by configuration') 5386 msg = _(b'update destination required by configuration')
5387 hint = _(b'use hg pull followed by hg update DEST') 5387 hint = _(b'use hg pull followed by hg update DEST')
5388 raise error.InputError(msg, hint=hint) 5388 raise error.InputError(msg, hint=hint)
5389 5389
5390 if not sources: 5390 sources = urlutil.get_pull_paths(repo, ui, sources, opts.get(b'branch'))
5391 sources = [b'default'] 5391 for source, branches in sources:
5392 for source in sources:
5393 source, branches = urlutil.parseurl(
5394 ui.expandpath(source), opts.get(b'branch')
5395 )
5396 ui.status(_(b'pulling from %s\n') % urlutil.hidepassword(source)) 5392 ui.status(_(b'pulling from %s\n') % urlutil.hidepassword(source))
5397 ui.flush() 5393 ui.flush()
5398 other = hg.peer(repo, opts, source) 5394 other = hg.peer(repo, opts, source)
5399 update_conflict = None 5395 update_conflict = None
5400 try: 5396 try: