[PATCH 1 of 1] ui, color: use labels for displaying paths

Marc Simpson marc at 0branch.com
Wed Aug 31 13:24:21 CDT 2011


# HG changeset patch
# User Marc Simpson <marc at 0branch.com>
# Date 1314814749 -3600
# Node ID 3ec02959f221433c609e633ce3054202469b19f5
# Parent  cc16323e748da5f3583df18d23f24988546714a7
ui, color: use labels for displaying paths

diff -r cc16323e748d -r 3ec02959f221 hgext/color.py
--- a/hgext/color.py	Tue Aug 30 15:22:10 2011 +0200
+++ b/hgext/color.py	Wed Aug 31 19:19:09 2011 +0100
@@ -71,6 +71,9 @@
   tags.normal = green
   tags.local = black bold
 
+  paths.name = green
+  paths.path = yellow
+
 The available effects in terminfo mode are 'blink', 'bold', 'dim',
 'inverse', 'invisible', 'italic', 'standout', and 'underline'; in
 ECMA-48 mode, the options are 'bold', 'inverse', 'italic', and
@@ -251,6 +254,8 @@
            'diffstat.inserted': 'green',
            'ui.prompt': 'yellow',
            'log.changeset': 'yellow',
+           'paths.name': 'green',
+           'paths.path': 'yellow',
            'resolve.resolved': 'green bold',
            'resolve.unresolved': 'red bold',
            'status.added': 'green bold',
diff -r cc16323e748d -r 3ec02959f221 mercurial/commands.py
--- a/mercurial/commands.py	Tue Aug 30 15:22:10 2011 +0200
+++ b/mercurial/commands.py	Wed Aug 31 19:19:09 2011 +0100
@@ -3723,7 +3723,9 @@
             if ui.quiet:
                 ui.write("%s\n" % name)
             else:
-                ui.write("%s = %s\n" % (name, util.hidepassword(path)))
+                name = ui.label(str(name).ljust(29), 'paths.name')
+                path = ui.label(util.hidepassword(path), 'paths.path')
+                ui.write("%s %s\n" % (name, path))
 
 def postincoming(ui, repo, modheads, optupdate, checkout):
     if modheads == 0:


More information about the Mercurial-devel mailing list