[PATCH stable] localrepo: more specific warning on adding large files
Martin Geisler
mg at lazybytes.net
Tue Mar 16 04:45:07 CDT 2010
# HG changeset patch
# User Martin Geisler <mg at lazybytes.net>
# Date 1268732659 -3600
# Branch stable
# Node ID 4548abc10fbc0009bbb3bd758cb7c006a204255c
# Parent cfc89fecfe51b21cb26c08268ae64acd2bb0c856
localrepo: more specific warning on adding large files
diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -1091,10 +1091,10 @@
rejected.append(f)
continue
if st.st_size > 10000000:
- self.ui.warn(_("%s: files over 10MB may cause memory and"
- " performance problems\n"
+ self.ui.warn(_("%s: you will now need at least %d MB "
+ "of RAM to work with this repository\n"
"(use 'hg revert %s' to unadd the file)\n")
- % (f, f))
+ % (f, 3 * st.st_size // 1000000, f))
if not (stat.S_ISREG(st.st_mode) or stat.S_ISLNK(st.st_mode)):
self.ui.warn(_("%s not added: only files and symlinks "
"supported currently\n") % f)
More information about the Mercurial-devel
mailing list