This is an archive of the discontinued Mercurial Phabricator instance.

ui: make the large file warning limit fully configurable
ClosedPublic

Authored by joerg.sonnenberger on Jul 6 2018, 11:57 AM.

Details

Summary

While add --large can be used to override it selectively, often enough
the user simply doesn't care about machines with less than 100MB RAM or
so, so make it possible to just specify a larger limit in hgrc.

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

yuja added a subscriber: yuja.Jul 6 2018, 10:51 PM

The idea looks good.

While add --large can be used to override it selectively, often enough
the user simply doesn't care about machines with less than 100MB RAM or
so, so make it possible to just specify a larger limit in hgrc.

I think --large is the option to add a file as largefile of the largefiles
extension.

  • if st.st_size > 10000000:

+ limit = ui.config('ui', 'largefilelimit')
+ if limit != 0 and st.st_size > limit:

ui.config() returns a string. Perhaps ui.configbytes() can be used
instead.

Can you add tests for limit=0 and st_size <= limit?

av6 added a subscriber: av6.Jul 7 2018, 2:39 AM
av6 added inline comments.
mercurial/configitems.py
1093
This revision was automatically updated to reflect the committed changes.