changeset 47032:6ce1af5f0764

template: use `list_paths` in `peerurls` Using common code will make it simpler to update the logic behind the path definition and storage. Differential Revision: https://phab.mercurial-scm.org/D10442
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 15 Apr 2021 11:50:08 +0200
parents 820fe29d0fd8
children 824ee4aaa09b
files mercurial/templatekw.py
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/templatekw.py	Thu Apr 15 11:48:29 2021 +0200
+++ b/mercurial/templatekw.py	Thu Apr 15 11:50:08 2021 +0200
@@ -27,7 +27,10 @@
     templateutil,
     util,
 )
-from .utils import stringutil
+from .utils import (
+    stringutil,
+    urlutil,
+)
 
 _hybrid = templateutil.hybrid
 hybriddict = templateutil.hybriddict
@@ -660,9 +663,8 @@
     repo = context.resource(mapping, b'repo')
     # see commands.paths() for naming of dictionary keys
     paths = repo.ui.paths
-    urls = util.sortdict(
-        (k, p.rawloc) for k, p in sorted(pycompat.iteritems(paths))
-    )
+    all_paths = urlutil.list_paths(repo.ui)
+    urls = util.sortdict((k, p.rawloc) for k, p in all_paths)
 
     def makemap(k):
         p = paths[k]