changeset 27725:64ee5866e107

paths: reorder else clause for readability of subsequent patches This prepares for porting to the formatter API. Future patches will use a single loop to handle both search=None|pattern cases because formatter output should be the same. "pathitems" will be switched instead.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 13 Dec 2015 21:55:57 +0900
parents c36fa631cb6e
children 7e9dc8bbebf6
files mercurial/commands.py
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Sun Dec 13 21:54:00 2015 +0900
+++ b/mercurial/commands.py	Sun Dec 13 21:55:57 2015 +0900
@@ -5407,14 +5407,15 @@
             ui.warn(_("not found!\n"))
         return 1
     else:
-        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.rawloc)))
-                for subopt, value in sorted(path.suboptions.items()):
-                    ui.write('%s:%s = %s\n' % (name, subopt, value))
+        pathitems = sorted(ui.paths.iteritems())
+
+    for name, path in pathitems:
+        if ui.quiet:
+            ui.write("%s\n" % name)
+        else:
+            ui.write("%s = %s\n" % (name, util.hidepassword(path.rawloc)))
+            for subopt, value in sorted(path.suboptions.items()):
+                ui.write('%s:%s = %s\n' % (name, subopt, value))
 
 @command('phase',
     [('p', 'public', False, _('set changeset phase to public')),