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
--- 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)