changeset 24251:a330660b3d71

commands.paths: use ui.paths to show paths We now have an API for representing a collection of paths. Use it.
author Gregory Szorc <gregory.szorc@gmail.com>
date Sat, 07 Feb 2015 12:49:30 -0800
parents 9c32eea2ca04
children f962692853c0
files mercurial/commands.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sat Feb 07 12:42:10 2015 -0800
+++ b/mercurial/commands.py	Sat Feb 07 12:49:30 2015 -0800
@@ -4826,19 +4826,20 @@
     Returns 0 on success.
     """
     if search:
-        for name, path in ui.configitems("paths"):
+        for name, path in sorted(ui.paths.iteritems()):
             if name == search:
-                ui.status("%s\n" % util.hidepassword(path))
+                ui.status("%s\n" % util.hidepassword(path.loc))
                 return
         if not ui.quiet:
             ui.warn(_("not found!\n"))
         return 1
     else:
-        for name, path in ui.configitems("paths"):
+        for name, path in sorted(ui.paths.iteritems()):
             if ui.quiet:
                 ui.write("%s\n" % name)
             else:
-                ui.write("%s = %s\n" % (name, util.hidepassword(path)))
+                ui.write("%s = %s\n" % (name,
+                                        util.hidepassword(path.loc)))
 
 @command('phase',
     [('p', 'public', False, _('set changeset phase to public')),