Browse Source

Fix "Number of files" output for attic info.

Closes #124
Jonas Borgström 10 years ago
parent
commit
678fdd1d42
3 changed files with 3 additions and 1 deletions
  1. 1 0
      CHANGES
  2. 1 1
      attic/archiver.py
  3. 1 0
      attic/testsuite/archiver.py

+ 1 - 0
CHANGES

@@ -12,6 +12,7 @@ Version 0.14
 - Add workaround for old Linux systems without acl_extended_file_no_follow (#96)
 - Add workaround for old Linux systems without acl_extended_file_no_follow (#96)
 - Add MacPorts' path to the default openssl search path (#101)
 - Add MacPorts' path to the default openssl search path (#101)
 - HashIndex improvements, eliminates unnecessary IO on low memory systems.
 - HashIndex improvements, eliminates unnecessary IO on low memory systems.
+- Fix "Number of files" output for attic info. (#124)
 
 
 Version 0.13
 Version 0.13
 ------------
 ------------

+ 1 - 1
attic/archiver.py

@@ -309,7 +309,7 @@ Type "Yes I am sure" if you understand this and want to continue.\n""")
         print('Username:', archive.metadata[b'username'])
         print('Username:', archive.metadata[b'username'])
         print('Time: %s' % to_localtime(archive.ts).strftime('%c'))
         print('Time: %s' % to_localtime(archive.ts).strftime('%c'))
         print('Command line:', remove_surrogates(' '.join(archive.metadata[b'cmdline'])))
         print('Command line:', remove_surrogates(' '.join(archive.metadata[b'cmdline'])))
-        print('Number of files: %d' % archive.stats.nfiles)
+        print('Number of files: %d' % stats.nfiles)
         stats.print_('This archive:', cache)
         stats.print_('This archive:', cache)
         return self.exit_code
         return self.exit_code
 
 

+ 1 - 0
attic/testsuite/archiver.py

@@ -159,6 +159,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
         self.assert_equal(len(self.attic('list', self.repository_location + '::test').splitlines()), 11)
         self.assert_equal(len(self.attic('list', self.repository_location + '::test').splitlines()), 11)
         self.assert_dirs_equal('input', 'output/input')
         self.assert_dirs_equal('input', 'output/input')
         info_output = self.attic('info', self.repository_location + '::test')
         info_output = self.attic('info', self.repository_location + '::test')
+        self.assert_in('Number of files: 4', info_output)
         shutil.rmtree(self.cache_path)
         shutil.rmtree(self.cache_path)
         info_output2 = self.attic('info', self.repository_location + '::test')
         info_output2 = self.attic('info', self.repository_location + '::test')
         # info_output2 starts with some "initializing cache" text but should
         # info_output2 starts with some "initializing cache" text but should