comparison 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
comparison
equal deleted inserted replaced
46931:d4e4ccb75f99 46932:dec31caf5fd6
1261 Helper for incoming / gincoming. 1261 Helper for incoming / gincoming.
1262 displaychlist gets called with 1262 displaychlist gets called with
1263 (remoterepo, incomingchangesetlist, displayer) parameters, 1263 (remoterepo, incomingchangesetlist, displayer) parameters,
1264 and is supposed to contain only code that can't be unified. 1264 and is supposed to contain only code that can't be unified.
1265 """ 1265 """
1266 source, branches = urlutil.parseurl( 1266 srcs = urlutil.get_pull_paths(repo, ui, [source], opts.get(b'branch'))
1267 ui.expandpath(source), opts.get(b'branch') 1267 srcs = list(srcs)
1268 ) 1268 if len(srcs) != 1:
1269 msg = _('for now, incoming supports only a single source, %d provided')
1270 msg %= len(srcs)
1271 raise error.Abort(msg)
1272 source, branches = srcs[0]
1269 other = peer(repo, opts, source) 1273 other = peer(repo, opts, source)
1270 cleanupfn = other.close 1274 cleanupfn = other.close
1271 try: 1275 try:
1272 ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(source)) 1276 ui.status(_(b'comparing with %s\n') % urlutil.hidepassword(source))
1273 revs, checkout = addbranchrevs(repo, other, branches, opts.get(b'rev')) 1277 revs, checkout = addbranchrevs(repo, other, branches, opts.get(b'rev'))