path: use `get_clone_path_obj` in share
The return is simpler to use, and this mean less user for the old function.
We directly use the `path` object to build the `peer` object.
--- a/mercurial/hg.py Fri Dec 02 16:42:36 2022 +0100
+++ b/mercurial/hg.py Fri Dec 02 16:49:54 2022 +0100
@@ -336,11 +336,12 @@
if not dest:
dest = defaultdest(source)
else:
- dest = urlutil.get_clone_path(ui, dest)[1]
+ dest = urlutil.get_clone_path_obj(ui, dest).loc
if isinstance(source, bytes):
- origsource, source, branches = urlutil.get_clone_path(ui, source)
- srcrepo = repository(ui, source)
+ source_path = urlutil.get_clone_path_obj(ui, source)
+ srcrepo = repository(ui, source_path.loc)
+ branches = (source_path.branch, [])
rev, checkout = addbranchrevs(srcrepo, srcrepo, branches, None)
else:
srcrepo = source.local()