mercurial/utils/urlutil.py
changeset 46910 df7439cc6806
parent 46909 067840864f37
child 46916 7061eee84151
--- a/mercurial/utils/urlutil.py	Mon Apr 12 22:22:56 2021 +0200
+++ b/mercurial/utils/urlutil.py	Tue Apr 13 12:28:44 2021 +0200
@@ -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)