share: use `get_clone_path`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 14 Apr 2021 18:37:29 +0200
changeset 46953 394cfc42c05c
parent 46952 82366464190a
child 46954 5d91eeac37ab
share: use `get_clone_path` Since `hg share` is mostly like clone, do the same changes there. Differential Revision: https://phab.mercurial-scm.org/D10419
mercurial/hg.py
--- a/mercurial/hg.py	Wed Apr 14 18:02:25 2021 +0200
+++ b/mercurial/hg.py	Wed Apr 14 18:37:29 2021 +0200
@@ -305,11 +305,10 @@
     if not dest:
         dest = defaultdest(source)
     else:
-        dest = ui.expandpath(dest)
+        dest = urlutil.get_clone_path(ui, dest)[1]
 
     if isinstance(source, bytes):
-        origsource = ui.expandpath(source)
-        source, branches = urlutil.parseurl(origsource)
+        origsource, source, branches = urlutil.get_clone_path(ui, source)
         srcrepo = repository(ui, source)
         rev, checkout = addbranchrevs(srcrepo, srcrepo, branches, None)
     else: