init: use `get_clone_path` when suitable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 14 Apr 2021 18:02:25 +0200
changeset 46952 82366464190a
parent 46951 338ab1d89ddb
child 46953 394cfc42c05c
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
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()