# HG changeset patch # User Pierre-Yves David # Date 2021-04-14 16:02:25 # 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 --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4376,7 +4376,8 @@ def init(ui, dest=b".", **opts): 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()