This is an archive of the discontinued Mercurial Phabricator instance.

filelog: stop proxying rawsize() (API)
ClosedPublic

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

Details

Summary

This method is no longer used by external consumers. The API is
quite low-level and is effectively len(revision(raw=True)). I don't
see a compelling reason to keep it around.

Let's drop the API and make the file storage interface simpler.

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

indygreg created this revision.Sep 26 2018, 2:28 PM
This revision was automatically updated to reflect the committed changes.

Apparently thg uses this to avoid loading the data into memory just to figure out the length like fctx.rawsize(). Any suggestions?

https://groups.google.com/d/msg/thg-dev/6ekYID7ho_o/fbdd6rVDAwAJ

Apparently thg uses this to avoid loading the data into memory just to figure out the length like fctx.rawsize(). Any suggestions?
https://groups.google.com/d/msg/thg-dev/6ekYID7ho_o/fbdd6rVDAwAJ

Just found this comment when going through mail backlog.

Do we want to do anything about this before the 4.8 release? We could restore the method/proxy easily enough. But I would prefer not to. I'd really like to know why thg wants to access the size of a revision without accessing the revision text...

CC @durin42

yuja added a subscriber: yuja.Nov 1 2018, 7:01 AM
> Apparently thg uses this to avoid loading the data into memory just to figure out the length like fctx.rawsize().  Any suggestions?
>
> https://groups.google.com/d/msg/thg-dev/6ekYID7ho_o/fbdd6rVDAwAJ
Just found this comment when going through mail backlog.
Do we want to do anything about this before the 4.8 release?

No. I've updated the caller to directly access to _revlog.

I'd really like to know why thg wants to access the size of a revision
without accessing the revision text...

In order to decide whether diff should be generated. There's a "max size
to show diff" config knob, and we don't want to load large blob into memory.

What we need is a light-weight method to get approximate data size.