mercurial/utils/urlutil.py
changeset 46934 ebb13f9a9ba8
parent 46928 93c224dc099b
child 46936 1998a8311c48
--- a/mercurial/utils/urlutil.py	Sun Apr 11 19:18:54 2021 +0200
+++ b/mercurial/utils/urlutil.py	Wed Apr 14 10:35:40 2021 +0200
@@ -471,6 +471,13 @@
         yield parseurl(url, default_branches)
 
 
+def get_clone_path(ui, source, default_branches=()):
+    """return the `(origsource, path, branch)` selected as clone source"""
+    url = ui.expandpath(source)
+    path, branch = parseurl(url, default_branches)
+    return url, path, branch
+
+
 def parseurl(path, branches=None):
     '''parse url#branch, returning (url, (branch, branches))'''
     u = url(path)