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

Augie Fackler raf at durin42.com
Sun Jun 18 22:29:41 EDT 2017


> On Jun 18, 2017, at 21:59, Augie Fackler <raf at durin42.com> wrote:
> 
>> 
>> 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?

I just noticed the tweakdefaults patch is pretty far back in the stack at this point. I can do a followup if the items I've mentioned here sound good (tomorrow, since it's time for me to sleep now...)

> 
> Thanks!
> Augie

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20170618/fcc88fdc/attachment.html>


More information about the Mercurial-devel mailing list