Changeset - 8a9d93838882
[Not reviewed]
stable
0 3 0
domruf - 10 years ago 2016-04-19 19:53:16
dominikruf@gmail.com
vcs: fix repo size calculation

tip.walk already 'dives into' the dirs - don't do that twice.
3 files changed with 2 insertions and 5 deletions:
0 comments (0 inline, 0 general)
kallithea/lib/vcs/backends/base.py
Show inline comments
 
@@ -123,9 +123,6 @@ class BaseRepository(object):
 
            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
kallithea/tests/vcs/test_git.py
Show inline comments
 
@@ -390,7 +390,7 @@ class GitChangesetTest(unittest.TestCase
 
            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
kallithea/tests/vcs/test_hg.py
Show inline comments
 
@@ -354,7 +354,7 @@ class MercurialChangesetTest(unittest.Te
 
            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
0 comments (0 inline, 0 general)