[Pkg-bazaar-commits] ./bzr/unstable r80: show_info: Show number of entries in the branch stores

mbp at sourcefrog.net mbp at sourcefrog.net
Fri Apr 10 07:51:05 UTC 2009


------------------------------------------------------------
revno: 80
committer: mbp at sourcefrog.net
timestamp: Thu 2005-03-24 11:26:38 +1100
message:
  show_info: Show number of entries in the branch stores
modified:
  bzrlib/info.py
  bzrlib/store.py
-------------- next part --------------
=== modified file 'bzrlib/info.py'
--- a/bzrlib/info.py	2005-03-24 00:21:35 +0000
+++ b/bzrlib/info.py	2005-03-24 00:26:38 +0000
@@ -74,3 +74,15 @@
         lastrev = b.get_revision(history[-1])
         print '  latest revision: %s' % format_date(lastrev.timestamp,
                                                     lastrev.timezone)
+
+    print
+    print 'text store:'
+    print '  %5d file texts' % len(b.text_store)
+
+    print
+    print 'revision store:'
+    print '  %5d revisions' % len(b.revision_store)
+
+    print
+    print 'inventory store:'
+    print '  %5d inventories' % len(b.inventory_store)

=== modified file 'bzrlib/store.py'
--- a/bzrlib/store.py	2005-03-09 04:08:15 +0000
+++ b/bzrlib/store.py	2005-03-24 00:26:38 +0000
@@ -110,6 +110,9 @@
     def __iter__(self):
         return iter(os.listdir(self._basedir))
 
+    def __len__(self):
+        return len(os.listdir(self._basedir))
+
     def __getitem__(self, fileid):
         """Returns a file reading from a particular entry."""
         return file(self._path(fileid), 'rb')



More information about the Pkg-bazaar-commits mailing list