##// END OF EJS Templates
bugfix, repo_size crashed when broken symlinks where inside a repository.
marcink -
r675:59670f09 beta
parent child Browse files
Show More
@@ -37,10 +37,16 b' def repo_size(ui, repo, hooktype=None, *'
37 for path, dirs, files in os.walk(repo.root):
37 for path, dirs, files in os.walk(repo.root):
38 if path.find('.hg') != -1:
38 if path.find('.hg') != -1:
39 for f in files:
39 for f in files:
40 try:
40 size_hg += os.path.getsize(os.path.join(path, f))
41 size_hg += os.path.getsize(os.path.join(path, f))
42 except OSError:
43 pass
41 else:
44 else:
42 for f in files:
45 for f in files:
46 try:
43 size_root += os.path.getsize(os.path.join(path, f))
47 size_root += os.path.getsize(os.path.join(path, f))
48 except OSError:
49 pass
44
50
45 size_hg_f = h.format_byte_size(size_hg)
51 size_hg_f = h.format_byte_size(size_hg)
46 size_root_f = h.format_byte_size(size_root)
52 size_root_f = h.format_byte_size(size_root)
General Comments 0
You need to be logged in to leave comments. Login now