dispatch: use the new API to resolve --repository
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 14 Apr 2021 20:57:34 +0200
changeset 46957 e7d082e4ace6
parent 46956 c5c2936f6fb2
child 46958 5a6a1cd21f09
dispatch: use the new API to resolve --repository An even weirder feature of Mercurial is the ability to use `[paths]` alias as value of `--repository`. The weird feature now use the new APIs. Differential Revision: https://phab.mercurial-scm.org/D10424
mercurial/dispatch.py
--- a/mercurial/dispatch.py	Wed Apr 14 20:21:11 2021 +0200
+++ b/mercurial/dispatch.py	Wed Apr 14 20:57:34 2021 +0200
@@ -50,6 +50,7 @@
 from .utils import (
     procutil,
     stringutil,
+    urlutil,
 )
 
 
@@ -990,7 +991,7 @@
             lui.readconfig(os.path.join(path, b".hg", b"hgrc-not-shared"), path)
 
     if rpath:
-        path = lui.expandpath(rpath)
+        path = urlutil.get_clone_path(lui, rpath)[0]
         lui = ui.copy()
         if rcutil.use_repo_hgrc():
             _readsharedsourceconfig(lui, path)