[PATCH 2 of 2 V2 mainline] format: introduce 'format.generaldelta=accept'
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Tue Nov 10 17:45:31 CST 2015
On 11/10/2015 09:38 AM, Pierre-Yves David wrote:
>
>
> On 11/09/2015 01:24 PM, Matt Mackall wrote:
>> On Sun, 2015-11-08 at 12:00 -0500, Pierre-Yves David wrote:
>>> # HG changeset patch
>>> # User Pierre-Yves David <pierre-yves.david at fb.com>
>>> # Date 1446479952 0
>>> # Mon Nov 02 15:59:12 2015 +0000
>>> # Node ID 3feb562d4e83fcbb7c59fa79b5749aae45de9fb1
>>> # Parent 69c64edb25dd96a23564db5b23b8b432b343ec88
>>> # EXP-Topic generaldelta
>>> # Available At http://hg.netv6.net/marmoute-wip/mercurial/
>>> # hg pull http://hg.netv6.net/marmoute-wip/mercurial/ -r
>>> 3feb562d4e83
>>> format: introduce 'format.generaldelta=accept'
>>
>>
>>> def gdconfig(ui):
>>> """helper function to retrieve general delta setting
>>>
>>> - The need for such function is triggered by a soon to come third
>>> possible
>>> - value to the config option."""
>>> + return (usegd, lazydelta) tuple
>>> +
>>> + usegd: create new repository as general delta,
>>> + lazydelta: do not redelta incoming bundle."""
>>> + # the r'' is a trick to have checkconfig ignore the type
>>> mismatch
>>> # experimental config: format.generaldelta
>>> - return ui.configbool('format', 'generaldelta', False)
>>> + if ui.config(r'format', 'generaldelta', '') == 'accept':
>>> + return True, True
>>> + # experimental config: format.generaldelta
>>> + usegd = ui.configbool('format', 'generaldelta', False)
>>> + return usegd, False
>>
>> Also, I don't think the logic here is nearly complex enough to warrant
>> a multi-value return. Let's just have two (nearly trivial) functions
>> defined next to each other.
>
> Without this 1 config, 3 value approach, I;m not sure how to garantee
> proper transition to a new default without breaking people who
> explicitly opted in the existing option.
>
> Currently there is three possibilitie
>
> A) people who did not set the config
> B) people who set the config to True
> C) people who set the confid to False (huho, really?)
>
> The goal here is to get (A) from "no general delta" to (B) "general
> delta lazy base". In parallel, (B) says "general delta, no lazy base".
>
> If we move to one config, three values (no, accept, yes) we can change
> (A) without affecting (B) nor (C). If we move to two binary config, we
> get want we want for (A) but we regresse (B). They explicit config will
> match the new default, but they won't have anything set override the new
> lazybase one. Leading to delta not being recomputed (unlike before).
>
>
> So we either:
> 1) go for the 1 config 3 value options
> 2) say screw this, it was experimental (for 3 years…) we have no BC
> 3) find a way I missed
Matt replied to V1 with a proposal that actually work (case 3). So I'm
going for it.
--
Pierre-Yves David
More information about the Mercurial-devel
mailing list