# HG changeset patch # User Pierre-Yves David # Date 2021-04-15 09:48:29 # Node ID 820fe29d0fd853e8ba632dc24228011b4ef9fbfb # Parent c2b5365aa827dd195b26101d216befd6fd109311 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 diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -5126,15 +5126,9 @@ def paths(ui, repo, search=None, **opts) """ 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():