mercurial/utils/urlutil.py
changeset 46934 ebb13f9a9ba8
parent 46928 93c224dc099b
child 46936 1998a8311c48
equal deleted inserted replaced
46933:9519312ecd81 46934:ebb13f9a9ba8
   469     for source in sources:
   469     for source in sources:
   470         url = ui.expandpath(source)
   470         url = ui.expandpath(source)
   471         yield parseurl(url, default_branches)
   471         yield parseurl(url, default_branches)
   472 
   472 
   473 
   473 
       
   474 def get_clone_path(ui, source, default_branches=()):
       
   475     """return the `(origsource, path, branch)` selected as clone source"""
       
   476     url = ui.expandpath(source)
       
   477     path, branch = parseurl(url, default_branches)
       
   478     return url, path, branch
       
   479 
       
   480 
   474 def parseurl(path, branches=None):
   481 def parseurl(path, branches=None):
   475     '''parse url#branch, returning (url, (branch, branches))'''
   482     '''parse url#branch, returning (url, (branch, branches))'''
   476     u = url(path)
   483     u = url(path)
   477     branch = None
   484     branch = None
   478     if u.fragment:
   485     if u.fragment: