Patchwork D10441: paths: use `list_paths` in `hg paths`

login
register
mail settings
Submitter phabricator
Date April 16, 2021, 12:03 a.m.
Message ID <differential-rev-PHID-DREV-7etvsdrbelsr6v62vkxk-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48758/
State Superseded
Headers show

Comments

phabricator - April 16, 2021, 12:03 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Using common code will make it simpler to update the logic behind the path
  definition and storage.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/commands.py

CHANGE DETAILS




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

Patch

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -5128,15 +5128,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():