This is an archive of the discontinued Mercurial Phabricator instance.

revlog: resolve lfs rawtext to vanilla rawtext before applying delta
ClosedPublic

Authored by quark on Feb 6 2018, 8:14 PM.

Details

Summary

This happens when a LFS delta base gets a non-LFS delta from another client.
In that case, the LFS delta base needs to be converted to non-LFS version
before applying the delta.

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

quark created this revision.Feb 6 2018, 8:14 PM
quark updated this revision to Diff 5267.Feb 6 2018, 8:19 PM
quark updated this revision to Diff 5271.Feb 6 2018, 9:13 PM
indygreg requested changes to this revision.Feb 7 2018, 5:36 PM

I'd like to see the next versions of hte previous 2 patches before looking at this because this patch will likely get some minor rework as well.

This revision now requires changes to proceed.Feb 7 2018, 5:36 PM
quark updated this revision to Diff 5652.Feb 13 2018, 2:41 PM
ryanmce accepted this revision.Mar 3 2018, 2:37 PM
quark updated this revision to Diff 6471.Mar 3 2018, 3:27 PM
indygreg accepted this revision.Mar 6 2018, 1:53 PM

This change is a bit difficult to reason about. But I think it is fine.

Essentially, we're ensuring that the delta stored in the revlog is applied on top of the fulltext after flag transformation rather than before. In the common case where we have no flag processors, this doesn't matter. In the case of LFS, it ensures LFS content resolution is performed first so we can delta against that.

On the addrevision side, we're now taking the size of the flag resolved content rather than the raw content. In the common case of no flag processors, the new behavior is identical. In the case of LFS, we compute the size of the LFS resolved data rather than the pointer record.

This revision is now accepted and ready to land.Mar 6 2018, 1:53 PM
This revision was automatically updated to reflect the committed changes.