equal
deleted
inserted
replaced
2142 with most diff parsers |
2142 with most diff parsers |
2143 ''' |
2143 ''' |
2144 def get(key, name=None, getter=ui.configbool, forceplain=None): |
2144 def get(key, name=None, getter=ui.configbool, forceplain=None): |
2145 if opts: |
2145 if opts: |
2146 v = opts.get(key) |
2146 v = opts.get(key) |
2147 if v: |
2147 # diffopts flags are either None-default (which is passed |
|
2148 # through unchanged, so we can identify unset values), or |
|
2149 # some other falsey default (eg --unified, which defaults |
|
2150 # to an empty string). We only want to override the config |
|
2151 # entries from hgrc with command line values if they |
|
2152 # appear to have been set, which is any truthy value, |
|
2153 # True, or False. |
|
2154 if v or isinstance(v, bool): |
2148 return v |
2155 return v |
2149 if forceplain is not None and ui.plain(): |
2156 if forceplain is not None and ui.plain(): |
2150 return forceplain |
2157 return forceplain |
2151 return getter(section, name or key, None, untrusted=untrusted) |
2158 return getter(section, name or key, None, untrusted=untrusted) |
2152 |
2159 |