# HG changeset patch # User Pierre-Yves David # Date 2022-12-02 15:49:54 # Node ID 5f36784c300f95c55dbccbdaf1b255a3230cd94f # Parent f22364e4eb133a388f931872f36d666240cfe826 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. diff --git a/mercurial/hg.py b/mercurial/hg.py --- a/mercurial/hg.py +++ b/mercurial/hg.py @@ -336,11 +336,12 @@ def share( 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()