comparison mercurial/localrepo.py @ 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 3900f684a150
children 22ebd6ee5672
comparison
equal deleted inserted replaced
4474:08ae451148b2 4475:e8a584067825
1004 if not wlock: 1004 if not wlock:
1005 wlock = self.wlock() 1005 wlock = self.wlock()
1006 for f in list: 1006 for f in list:
1007 p = self.wjoin(f) 1007 p = self.wjoin(f)
1008 islink = os.path.islink(p) 1008 islink = os.path.islink(p)
1009 size = os.lstat(p).st_size
1010 if size > 10000000:
1011 self.ui.warn(_("%s: files over 10MB may cause memory and"
1012 " performance problems\n"
1013 "(use 'hg revert %s' to unadd the file)\n")
1014 % (f, f))
1009 if not islink and not os.path.exists(p): 1015 if not islink and not os.path.exists(p):
1010 self.ui.warn(_("%s does not exist!\n") % f) 1016 self.ui.warn(_("%s does not exist!\n") % f)
1011 elif not islink and not os.path.isfile(p): 1017 elif not islink and not os.path.isfile(p):
1012 self.ui.warn(_("%s not added: only files and symlinks " 1018 self.ui.warn(_("%s not added: only files and symlinks "
1013 "supported currently\n") % f) 1019 "supported currently\n") % f)