Comments
Patch
@@ -453,6 +453,15 @@
yield ui.getpath(dest, default=(b'default-push', b'default'))
+def get_pull_paths(repo, ui, sources, default_branches=()):
+ """yields all the `(path, branch)` selected as pull source by `sources`"""
+ if not sources:
+ sources = [b'default']
+ for source in sources:
+ url = ui.expandpath(source)
+ yield parseurl(url, default_branches)
+
+
def parseurl(path, branches=None):
'''parse url#branch, returning (url, (branch, branches))'''
u = url(path)
@@ -5386,12 +5386,8 @@
hint = _(b'use hg pull followed by hg update DEST')
raise error.InputError(msg, hint=hint)
- if not sources:
- sources = [b'default']
- for source in sources:
- source, branches = urlutil.parseurl(
- ui.expandpath(source), opts.get(b'branch')
- )
+ sources = urlutil.get_pull_paths(repo, ui, sources, opts.get(b'branch'))
+ for source, branches in sources:
ui.status(_(b'pulling from %s\n') % urlutil.hidepassword(source))
ui.flush()
other = hg.peer(repo, opts, source)