This is an archive of the discontinued Mercurial Phabricator instance.

revlog: recommit 49fd21f32695 with a fix for issue6528
ClosedPublic

Authored by joerg.sonnenberger on Jul 20 2021, 9:57 AM.

Details

Summary

filelog.size currently special cases two forms of metadata encoding:

  • copy data via the parent order as flag bit
  • censor data by peaking into the raw delta

All other forms of metadata encoding including the empty metadata block
are mishandled. In basefilectx.cmp the empty metadata block is
explicitly checked to compensate for this.

Restore 49fd21f32695, but disable it for filelog, so that the original
flag bit use contines to work. Document all this mess for now in
preparation of a proper rework.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

This looks fine, but we should probably take it for 6.0 instead of 5.9 to stay on the safe side. Is there anything actively broken by not having this?

(I am also tempted to suggest we default canonical_parent_order to False too)

Regardless on this, we also need a script to fix parent order in repository where it got corrupt.

I would have to reaudit the parents use, but it wasn't just new code that misbehaves on misordered parents. E.g. memctx.parents for a trivial example. So yes, just backing it out introduces regressions as well.

Alphare accepted this revision.Aug 24 2021, 12:03 PM
Alphare added a subscriber: Alphare.

This looks fine (which is what I said last time... but really this time!).

This revision is now accepted and ready to land.Aug 24 2021, 12:03 PM

Seems like a good fix, needs rebased

Should this really be for stable? Does this fix any known bug or can it be queued for default instead? Sorry if I forgot the answer to this question, but I see no indication of a bugfix in the commit itself.

mercurial/revlog.py
380

s/obuses/abuses/

joerg.sonnenberger marked an inline comment as done.Tue, Mar 29, 8:56 AM
joerg.sonnenberger updated this revision to Diff 32728.

default should be fine. There are a number of places that don't necessarily work correctly for miss-ordered parents, but that's been the default behavior for years too, so nothing new.

Alphare added inline comments.Wed, Apr 6, 5:59 AM
mercurial/revlog.py
933

This should be removed, and nullid should be self.nullid. I'll amend on-the-fly, this has been too long in the works.