changeset 47031:820fe29d0fd8

paths: use `list_paths` in `hg paths` Using common code will make it simpler to update the logic behind the path definition and storage. Differential Revision: https://phab.mercurial-scm.org/D10441
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 15 Apr 2021 11:48:29 +0200
parents c2b5365aa827
children 6ce1af5f0764
files mercurial/commands.py
diffstat 1 files changed, 2 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Thu Apr 15 11:46:31 2021 +0200
+++ b/mercurial/commands.py	Thu Apr 15 11:48:29 2021 +0200
@@ -5126,15 +5126,9 @@
     """
 
     opts = pycompat.byteskwargs(opts)
+
+    pathitems = urlutil.list_paths(ui, search)
     ui.pager(b'paths')
-    if search:
-        pathitems = [
-            (name, path)
-            for name, path in pycompat.iteritems(ui.paths)
-            if name == search
-        ]
-    else:
-        pathitems = sorted(pycompat.iteritems(ui.paths))
 
     fm = ui.formatter(b'paths', opts)
     if fm.isplain():