Rev 3806: Add size information to the mutter when -Dpack is used. in http://bzr.arbash-meinel.com/branches/bzr/brisbane/chk_map

John Arbash Meinel john at arbash-meinel.com
Wed Dec 3 04:11:50 GMT 2008


At http://bzr.arbash-meinel.com/branches/bzr/brisbane/chk_map

------------------------------------------------------------
revno: 3806
revision-id: john at arbash-meinel.com-20081203041138-ecssp5m0mqxjgzhu
parent: john at arbash-meinel.com-20081203035643-0x4npc4s8mh8nqlh
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: chk_map
timestamp: Tue 2008-12-02 22:11:38 -0600
message:
  Add size information to the mutter when -Dpack is used.
  
  Also fix a bug in -Dpack when the repository doesn't support chk_bytes.
-------------- next part --------------
=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2008-12-03 03:56:43 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2008-12-03 04:11:38 +0000
@@ -407,9 +407,15 @@
                 '../packs/' + self.name + '.pack')
         self._state = 'finished'
         if 'pack' in debug.debug_flags:
+            try:
+                size = self.pack_transport.stat(self.name + '.pack').st_size
+                size /= 1024.*1024
+            except errors.TransportNotPossible:
+                size = -1
             # XXX: size might be interesting?
-            mutter('%s: create_pack: pack renamed into place: %s%s->%s%s t+%6.3fs',
-                time.ctime(), self.upload_transport.base, self.random_name,
+            mutter('%s: create_pack: pack renamed into place (%.3fMB): %s%s->%s%s'
+                   ' t+%6.3fs',
+                time.ctime(), size, self.upload_transport.base, self.random_name,
                 self.pack_transport, self.name,
                 time.time() - self.start_time)
 
@@ -756,10 +762,17 @@
                 rev_count = len(self.revision_ids)
             else:
                 rev_count = 'all'
-            mutter('%s: create_pack: creating pack from source packs: '
+            size = 0
+            for a_pack in self.packs:
+                try:
+                    size += a_pack.pack_transport.stat(a_pack.name + '.pack').st_size
+                except errors.TransportNotPossible:
+                    pass
+            size /= 1024.*1024
+            mutter('%s: create_pack: creating pack from source packs (%.3fMB): '
                 '%s%s %s revisions wanted %s t=0',
-                time.ctime(), self._pack_collection._upload_transport.base, new_pack.random_name,
-                plain_pack_list, rev_count)
+                time.ctime(), size, self._pack_collection._upload_transport.base,
+                new_pack.random_name, plain_pack_list, rev_count)
         self._copy_revision_texts()
         self._copy_inventory_texts()
         self._copy_text_texts()
@@ -783,12 +796,12 @@
         # the items? How should that interact with stacked repos?
         if new_pack.chk_index is not None:
             self._copy_chks()
-        if 'pack' in debug.debug_flags:
-            mutter('%s: create_pack: chk content copied: %s%s %d items t+%6.3fs',
-                time.ctime(), self._pack_collection._upload_transport.base,
-                new_pack.random_name,
-                new_pack.chk_index.key_count(),
-                time.time() - new_pack.start_time)
+            if 'pack' in debug.debug_flags:
+                mutter('%s: create_pack: chk content copied: %s%s %d items t+%6.3fs',
+                    time.ctime(), self._pack_collection._upload_transport.base,
+                    new_pack.random_name,
+                    new_pack.chk_index.key_count(),
+                    time.time() - new_pack.start_time)
         self._check_references()
         if not self._use_pack(new_pack):
             new_pack.abort()



More information about the bazaar-commits mailing list