Code review comment for lp:~weyrick/bzr/54624-warn-on-large-files

Revision history for this message
Shannon Weyrick (weyrick) wrote :

Ok, thanks for the feedback everyone. To summarize then, here are my goals for completing this:

1) Ensure that skipping a large file doesn't happen directly in MutableTree.smart_add, but rather find a way to have the skip take place in the ui. This part may need more discussion - clearly we don't want to scan files in the ui _and_ in smart_add, but the latter is where all the scanning takes place now. AFAICT, by the time control returns to the ui, the adds have taken place. Only a count of files added is returned right now. Even if it returned the full add list, it would have to make calls to unadd/revert them at that point, I believe. Doesn't seem ideal, but let me know if that's desirable. Otherwise, I'm thinking either an optional callback of some sort (maybe similar to the existing AddAction - i.e. a new SkipAction?), or possibly making some code from _SmartAddHelper more central. Other ideas from those more knowledgeable with the codebase obviously welcome here.

2) Ensure that the stat for filesize is cached. Benchmark on large import.

3) Add a simple parser for specifying values in "human readable" sizes (i.e. "500M") to Config

4) Default limit to 20M

5) Possibly prompt user if the limit is hit and they haven't overridden the default

6) Use config name "add.maximum_file_size"

7) Document in configuration.txt and user docs

« Back to merge proposal