comparison mercurial/context.py @ 38601:a936d1368fc5

ui: make the large file warning limit fully configurable 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. Differential Revision: https://phab.mercurial-scm.org/D3893
author Joerg Sonnenberger <joerg@bec.de>
date Fri, 06 Jul 2018 17:57:46 +0200
parents 91618801d5c3
children 760cc5dc01e8
comparison
equal deleted inserted replaced
38600:f9805627af1f 38601:a936d1368fc5
1339 st = lstat(f) 1339 st = lstat(f)
1340 except OSError: 1340 except OSError:
1341 ui.warn(_("%s does not exist!\n") % uipath(f)) 1341 ui.warn(_("%s does not exist!\n") % uipath(f))
1342 rejected.append(f) 1342 rejected.append(f)
1343 continue 1343 continue
1344 if st.st_size > 10000000: 1344 limit = ui.configbytes('ui', 'large-file-limit')
1345 if limit != 0 and st.st_size > limit:
1345 ui.warn(_("%s: up to %d MB of RAM may be required " 1346 ui.warn(_("%s: up to %d MB of RAM may be required "
1346 "to manage this file\n" 1347 "to manage this file\n"
1347 "(use 'hg revert %s' to cancel the " 1348 "(use 'hg revert %s' to cancel the "
1348 "pending addition)\n") 1349 "pending addition)\n")
1349 % (f, 3 * st.st_size // 1000000, uipath(f))) 1350 % (f, 3 * st.st_size // 1000000, uipath(f)))