comparison mercurial/dispatch.py @ 31110:7fec37746417

color: add a 'ui.color' option to control color behavior This new option control whether or not color will be used. It mirror the behavior of '--color'. I usually avoid adding new option to '[ui]' as the section is already filled with many option. However, I feel like 'color' is central enough to deserves a spot in this '[ui]' section. For now the option is not documented so it is still marked as experimental. Once it get documented and official, we should be able to deprecate the color extensions. There is more cleanup to do before that documentation is written, but we need this option early to made them. Having that option will allow for more cleanup of the initialisation process and proper separation between color configuration.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sat, 25 Feb 2017 19:44:23 +0100
parents 45be7590301d
children 49ad6bf63107
comparison
equal deleted inserted replaced
31109:53230c5bb273 31110:7fec37746417
763 if cmdoptions.get('insecure', False): 763 if cmdoptions.get('insecure', False):
764 for ui_ in uis: 764 for ui_ in uis:
765 ui_.insecureconnections = True 765 ui_.insecureconnections = True
766 766
767 # setup color handling 767 # setup color handling
768 coloropt = options['color']
768 for ui_ in uis: 769 for ui_ in uis:
769 color.setup(ui_, options['color']) 770 if coloropt:
771 ui_.setconfig('ui', 'color', coloropt, '--color')
772 color.setup(ui_)
770 773
771 if options['version']: 774 if options['version']:
772 return commands.version_(ui) 775 return commands.version_(ui)
773 if options['help']: 776 if options['help']:
774 return commands.help_(ui, cmd, command=cmd is not None) 777 return commands.help_(ui, cmd, command=cmd is not None)