Patchwork D10424: dispatch: use the new API to resolve --repository

login
register
mail settings
Submitter phabricator
Date April 14, 2021, 11:41 p.m.
Message ID <differential-rev-PHID-DREV-dwl6w5rxctszmciamlra-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48739/
State Superseded
Headers show

Comments

phabricator - April 14, 2021, 11:41 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10424

AFFECTED FILES
  mercurial/dispatch.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py
--- a/mercurial/dispatch.py
+++ b/mercurial/dispatch.py
@@ -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)