##// END OF EJS Templates
urlutil: add a `get_clone_path` function...
marmoute -
r47696:ebb13f9a default
parent child Browse files
Show More
@@ -672,8 +672,8 b' def clone('
672 """
672 """
673
673
674 if isinstance(source, bytes):
674 if isinstance(source, bytes):
675 origsource = ui.expandpath(source)
675 src = urlutil.get_clone_path(ui, source, branch)
676 source, branches = urlutil.parseurl(origsource, branch)
676 origsource, source, branches = src
677 srcpeer = peer(ui, peeropts, source)
677 srcpeer = peer(ui, peeropts, source)
678 else:
678 else:
679 srcpeer = source.peer() # in case we were called with a localrepo
679 srcpeer = source.peer() # in case we were called with a localrepo
@@ -471,6 +471,13 b' def get_pull_paths(repo, ui, sources, de'
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)
General Comments 0
You need to be logged in to leave comments. Login now