This is an archive of the discontinued Mercurial Phabricator instance.

filelog: return correct size when content begins with metadata prefix
ClosedPublic

Authored by indygreg on Sep 26 2018, 2:28 PM.

Details

Summary

An inline TODO tracked this. And we were reminded of it when
recently implementing storage integration tests. Let's fix it so
we don't have to port the buggy behavior to future storage backends.

The new call to read() should be fast because the revision
fulltext should be cached as part of calling renamed(). So the
overhead here should be minimal.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

indygreg created this revision.Sep 26 2018, 2:28 PM
This revision was automatically updated to reflect the committed changes.
yuja added a subscriber: yuja.Sep 29 2018, 12:46 AM
The new call to read() should be fast because the revision
fulltext should be cached as part of calling renamed(). So the
overhead here should be minimal.

That isn't true unfortunately. renamed() reads the text only if p1 is null,
so size() was cheap in most cases. This patch makes size() as slow as
len(read()).

Jun also had concerns about the perf implications of this changeset. We decided to drop this from hg-committed.