[PATCH 1 of 2] paths: colorize 'default' and 'default-push'

Idan Kamara idankk86 at gmail.com
Sat Sep 22 13:54:00 UTC 2012


# HG changeset patch
# User Idan Kamara <idankk86 at gmail.com>
# Date 1348321503 -10800
# Branch stable
# Node ID 575cb6034535925ab0344c1e7f01de601a015625
# Parent  6e2ab601be3f4b9f5b05d62e640a35d2366154c6
paths: colorize 'default' and 'default-push'

diff --git a/hgext/color.py b/hgext/color.py
--- a/hgext/color.py
+++ b/hgext/color.py
@@ -253,7 +253,8 @@
            'status.removed': 'red bold',
            'status.unknown': 'magenta bold underline',
            'tags.normal': 'green',
-           'tags.local': 'black bold'}
+           'tags.local': 'black bold',
+           'paths.default' : 'green'}
 
 
 def _effect_str(effect):
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -4449,10 +4449,15 @@
         return 1
     else:
         for name, path in ui.configitems("paths"):
+            if name in ('default', 'default-push'):
+                label = 'paths.default'
+            else:
+                label = ''
             if ui.quiet:
-                ui.write("%s\n" % name)
+                ui.write("%s\n" % name, label=label)
             else:
-                ui.write("%s = %s\n" % (name, util.hidepassword(path)))
+                ui.write("%s = %s\n" % (name, util.hidepassword(path)),
+                         label=label)
 
 @command('^phase',
     [('p', 'public', False, _('set changeset phase to public')),


More information about the Mercurial-devel mailing list