[PATCH 03 of 15] commitctx: extract copy information encoding into extra into commit.py

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Sep 23 07:03:21 UTC 2020



On 9/7/20 9:41 PM, Augie Fackler wrote:
> 
> 
>> On Jul 29, 2020, at 12:57 PM, Pierre-Yves David <pierre-yves.david at ens-lyon.org> wrote:
>>
>> # HG changeset patch
>> # User Pierre-Yves David <pierre-yves.david at octobus.net>
>> # Date 1595682805 -7200
>> #      Sat Jul 25 15:13:25 2020 +0200
>> # Node ID 3e4e9837d03bd1345438e69ae154b72daa5cee6b
>> # Parent  a926f7ac92a4024511389ea5c5d9a8e8eae065d4
>> # EXP-Topic files-change
>> # Available At https://foss.heptapod.net/octobus/mercurial-devel/
>> #              hg pull https://foss.heptapod.net/octobus/mercurial-devel/ -r 3e4e9837d03b
>> commitctx: extract copy information encoding into extra into commit.py
> 
> [snip]
> 
>> --- a/mercurial/commit.py
>> +++ b/mercurial/commit.py
>> @@ -69,6 +69,20 @@ def commitctx(repo, ctx, error=False, or
>>
>>          extra = ctx.extra().copy()
>>
>> +        files = sorted(files)
>> +        if extra is not None:
>> +            for name in (
>> +                b'p1copies',
>> +                b'p2copies',
>> +                b'filesadded',
>> +                b'filesremoved',
>> +            ):
>> +                extra.pop(name, None)
>> +        if repo.changelog._copiesstorage == b'extra':
> 
> This kind of abstraction-breaking needs to stop being a crutch in our codebase: this broke the git extension because it bypasses the revlog interface, and probably also broke the sql storage extension. I’ll see about mailing a workaround.
> 
> (I’m not very upset, but wanted to bring this up since it’s not the first time I’ve observed this kind of architectural backsliding in low-level core code in 2020.)

My plan here is mostly to do a large cleanup once the sidedata copy 
tracing is ready for prime time and the "extra" mode can be eventually 
dropped.

-- 
Pierre-Yves David



More information about the Mercurial-devel mailing list