# HG changeset patch # User domruf # Date 1461088396 -7200 # Node ID 8a9d938388829c676ca2378780533b8280630ded # Parent 43d23fa871d8e1bef3467e5991c6726a5a1cf549 vcs: fix repo size calculation tip.walk already 'dives into' the dirs - don't do that twice. diff -r 43d23fa871d8 -r 8a9d93838882 kallithea/lib/vcs/backends/base.py --- a/kallithea/lib/vcs/backends/base.py Sun Apr 24 19:29:20 2016 +0200 +++ b/kallithea/lib/vcs/backends/base.py Tue Apr 19 19:53:16 2016 +0200 @@ -123,9 +123,6 @@ for topnode, dirs, files in tip.walk('/'): for f in files: size += tip.get_file_size(f.path) - for dir in dirs: - for f in files: - size += tip.get_file_size(f.path) except RepositoryError as e: pass diff -r 43d23fa871d8 -r 8a9d93838882 kallithea/tests/vcs/test_git.py --- a/kallithea/tests/vcs/test_git.py Sun Apr 24 19:29:20 2016 +0200 +++ b/kallithea/tests/vcs/test_git.py Tue Apr 19 19:53:16 2016 +0200 @@ -390,7 +390,7 @@ self._test_dir_size(revision, path, size) def test_repo_size(self): - self.assertEqual(self.repo.size, 1022026) # FIXME + self.assertEqual(self.repo.size, 674076) def test_file_history(self): # we can only check if those revisions are present in the history diff -r 43d23fa871d8 -r 8a9d93838882 kallithea/tests/vcs/test_hg.py --- a/kallithea/tests/vcs/test_hg.py Sun Apr 24 19:29:20 2016 +0200 +++ b/kallithea/tests/vcs/test_hg.py Tue Apr 19 19:53:16 2016 +0200 @@ -354,7 +354,7 @@ self._test_dir_size(revision, path, size) def test_repo_size(self): - self.assertEqual(self.repo.size, 1042958) # FIXME + self.assertEqual(self.repo.size, 682421) def test_file_history(self): # we can only check if those revisions are present in the history