Mercurial > public > mercurial-scm > hg-stable
diff mercurial/hg.py @ 46932:dec31caf5fd6
incoming: use `urlutil.get_pull_paths`
Lets use the new method to increase code reuse. However I did not implement
support for multiple source yet. It would be possible create multiple temporary
bundle, but that is a bit too much work outside of my current route to make the
detour.
Differential Revision: https://phab.mercurial-scm.org/D10392
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Wed, 14 Apr 2021 02:14:15 +0200 |
parents | d4e4ccb75f99 |
children | ebb13f9a9ba8 |
line wrap: on
line diff
--- a/mercurial/hg.py Wed Apr 14 01:26:44 2021 +0200 +++ b/mercurial/hg.py Wed Apr 14 02:14:15 2021 +0200 @@ -1263,9 +1263,13 @@ (remoterepo, incomingchangesetlist, displayer) parameters, and is supposed to contain only code that can't be unified. """ - source, branches = urlutil.parseurl( - ui.expandpath(source), opts.get(b'branch') - ) + srcs = urlutil.get_pull_paths(repo, ui, [source], opts.get(b'branch')) + srcs = list(srcs) + if len(srcs) != 1: + msg = _('for now, incoming supports only a single source, %d provided') + msg %= len(srcs) + raise error.Abort(msg) + source, branches = srcs[0] other = peer(repo, opts, source) cleanupfn = other.close try: