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