commands.paths: use ui.paths to show paths
authorGregory Szorc <gregory.szorc@gmail.com>
Sat, 07 Feb 2015 12:49:30 -0800
changeset 24251 a330660b3d71
parent 24250 9c32eea2ca04
child 24252 f962692853c0
commands.paths: use ui.paths to show paths We now have an API for representing a collection of paths. Use it.
mercurial/commands.py
--- 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')),