init: use `get_clone_path` when suitable
`hg init` has this weird feature were you can refer to `[paths]` entry select the path to initialize. We move that code to the new APIs.
Differential Revision: https://phab.mercurial-scm.org/D10418
--- a/mercurial/commands.py Wed Apr 14 18:34:42 2021 +0200
+++ b/mercurial/commands.py Wed Apr 14 18:02:25 2021 +0200
@@ -4376,7 +4376,8 @@
Returns 0 on success.
"""
opts = pycompat.byteskwargs(opts)
- peer = hg.peer(ui, opts, ui.expandpath(dest), create=True)
+ path = urlutil.get_clone_path(ui, dest)[1]
+ peer = hg.peer(ui, opts, path, create=True)
peer.close()