##// END OF EJS Templates
path: return path instance directly from get_pull_paths...
marmoute -
r49054:607e9322 default
parent child Browse files
Show More
@@ -4346,8 +4346,11 b' def incoming(ui, repo, source=b"default"'
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'):
@@ -5393,8 +5396,8 b' def pull(ui, repo, *sources, **opts):'
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)
@@ -1261,13 +1261,14 b' def _incoming('
1261 (remoterepo, incomingchangesetlist, displayer) parameters,
1261 (remoterepo, incomingchangesetlist, displayer) parameters,
1262 and is supposed to contain only code that can't be unified.
1262 and is supposed to contain only code that can't be unified.
1263 """
1263 """
1264 srcs = urlutil.get_pull_paths(repo, ui, [source], opts.get(b'branch'))
1264 srcs = urlutil.get_pull_paths(repo, ui, [source])
1265 srcs = list(srcs)
1265 srcs = list(srcs)
1266 if len(srcs) != 1:
1266 if len(srcs) != 1:
1267 msg = _(b'for now, incoming supports only a single source, %d provided')
1267 msg = _(b'for now, incoming supports only a single source, %d provided')
1268 msg %= len(srcs)
1268 msg %= len(srcs)
1269 raise error.Abort(msg)
1269 raise error.Abort(msg)
1270 source, branches = srcs[0]
1270 path = srcs[0]
1271 source, branches = urlutil.parseurl(path.rawloc, opts.get(b'branch'))
1271 if subpath is not None:
1272 if subpath is not None:
1272 subpath = urlutil.url(subpath)
1273 subpath = urlutil.url(subpath)
1273 if subpath.isabs():
1274 if subpath.isabs():
@@ -503,17 +503,17 b' def get_push_paths(repo, ui, dests):'
503 yield path
503 yield path
504
504
505
505
506 def get_pull_paths(repo, ui, sources, default_branches=()):
506 def get_pull_paths(repo, ui, sources):
507 """yields all the `(path, branch)` selected as pull source by `sources`"""
507 """yields all the `(path, branch)` selected as pull source by `sources`"""
508 if not sources:
508 if not sources:
509 sources = [b'default']
509 sources = [b'default']
510 for source in sources:
510 for source in sources:
511 if source in ui.paths:
511 if source in ui.paths:
512 for p in ui.paths[source]:
512 for p in ui.paths[source]:
513 yield parseurl(p.rawloc, default_branches)
513 yield p
514 else:
514 else:
515 p = path(ui, None, source, validate_path=False)
515 p = path(ui, None, source, validate_path=False)
516 yield parseurl(p.rawloc, default_branches)
516 yield p
517
517
518
518
519 def get_unique_push_path(action, repo, ui, dest=None):
519 def get_unique_push_path(action, repo, ui, dest=None):
General Comments 0
You need to be logged in to leave comments. Login now