[PATCH RFC] ui: add support for a tweakdefaults knob

Augie Fackler raf at durin42.com
Sun Jun 18 21:59:28 EDT 2017


> On Jun 17, 2017, at 01:01, Yuya Nishihara <yuya at tcha.org> wrote:
> 
>>> I have no idea how we should process values which are only set in untrusted
>>> config. Using hasconfig(untrusted=True) might be a bit safer, but there would
>>> still be inconsistency.
>> 
>> I thought untrusted was the default? Or do you just want it explicit?
> 
> untrusted is False by default. I think this and the repo config problems can
> be mitigated by not setting tweaked values to _ocfg.
> 
>   if not tcfg.hasitem(section, name):
>       tcfg.set(section, name, value, "<tweakdefaults>")
>   if not ucfg.hasitem(section, name):
>       ucfg.set(section, name, value, "<tweakdefaults>")
>   fixconfig()

Oh, I see the problem now. I'm not sure how to address that. It was intentional that tweakdefaults is only respected if it's a trusted config entry, so all its items can be treated as trusted.

I think your fix sounds reasonable for the setting of the config items. Should I roll a v3 that moves the tweakdefaults() call to dispatch and make it work this way instead of on (ab)using ui.setconfig?

Thanks!
Augie


More information about the Mercurial-devel mailing list