# HG changeset patch # User Pierre-Yves David # Date 1618416145 -7200 # Node ID 82366464190abbca9c06cb06ddc7ee4fb6b28fc9 # Parent 338ab1d89ddb6d528802b98e825fa71ccb8c4a3c 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 diff -r 338ab1d89ddb -r 82366464190a mercurial/commands.py --- 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()