path: use `get_clone_path_obj` in share
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 02 Dec 2022 16:49:54 +0100
changeset 49744 5f36784c300f
parent 49743 f22364e4eb13
child 49745 0d7ecac8b6f7
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.
mercurial/hg.py
--- 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()