equal
deleted
inserted
replaced
12 from .i18n import _ |
12 from .i18n import _ |
13 |
13 |
14 from . import ( |
14 from . import ( |
15 encoding, |
15 encoding, |
16 pycompat, |
16 pycompat, |
17 util |
17 ) |
|
18 |
|
19 from .utils import ( |
|
20 stringutil, |
18 ) |
21 ) |
19 |
22 |
20 try: |
23 try: |
21 import curses |
24 import curses |
22 # Mapping from effect name to terminfo attribute name (or raw code) or |
25 # Mapping from effect name to terminfo attribute name (or raw code) or |
198 if config == 'debug': |
201 if config == 'debug': |
199 return 'debug' |
202 return 'debug' |
200 |
203 |
201 auto = (config == 'auto') |
204 auto = (config == 'auto') |
202 always = False |
205 always = False |
203 if not auto and util.parsebool(config): |
206 if not auto and stringutil.parsebool(config): |
204 # We want the config to behave like a boolean, "on" is actually auto, |
207 # We want the config to behave like a boolean, "on" is actually auto, |
205 # but "always" value is treated as a special case to reduce confusion. |
208 # but "always" value is treated as a special case to reduce confusion. |
206 if ui.configsource('ui', 'color') == '--color' or config == 'always': |
209 if ui.configsource('ui', 'color') == '--color' or config == 'always': |
207 always = True |
210 always = True |
208 else: |
211 else: |