changeset 4475:e8a584067825

Warn about large files on hg add
author Matt Mackall <mpm@selenic.com>
date Fri, 01 Jun 2007 14:07:42 -0500
parents 08ae451148b2
children d46d3197a5d1
files mercurial/localrepo.py
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Fri Jun 01 19:49:09 2007 +0200
+++ b/mercurial/localrepo.py	Fri Jun 01 14:07:42 2007 -0500
@@ -1006,6 +1006,12 @@
         for f in list:
             p = self.wjoin(f)
             islink = os.path.islink(p)
+            size = os.lstat(p).st_size
+            if size > 10000000:
+                self.ui.warn(_("%s: files over 10MB may cause memory and"
+                               " performance problems\n"
+                               "(use 'hg revert %s' to unadd the file)\n")
+                               % (f, f))
             if not islink and not os.path.exists(p):
                 self.ui.warn(_("%s does not exist!\n") % f)
             elif not islink and not os.path.isfile(p):