# HG changeset patch # User Pierre-Yves David # Date 2021-04-15 09:50:08 # Node ID 74891f524559180b9ac803b0b78f2ffe4b52c002 # Parent 9bfe3818d7c5e2cad00a83fa1b940c151636ea92 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 diff --git a/mercurial/templatekw.py b/mercurial/templatekw.py --- a/mercurial/templatekw.py +++ b/mercurial/templatekw.py @@ -27,7 +27,10 @@ from . import ( templateutil, util, ) -from .utils import stringutil +from .utils import ( + stringutil, + urlutil, +) _hybrid = templateutil.hybrid hybriddict = templateutil.hybriddict @@ -660,9 +663,8 @@ def showpeerurls(context, mapping): 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]