--- 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)