Rev 2738: Various fixups found dogfooding. in http://people.ubuntu.com/~robertc/baz2.0/repository

Robert Collins robertc at robertcollins.net
Fri Aug 24 23:36:15 BST 2007


At http://people.ubuntu.com/~robertc/baz2.0/repository

------------------------------------------------------------
revno: 2738
revision-id: robertc at robertcollins.net-20070824223601-jcg909bzrls6d4jw
parent: robertc at robertcollins.net-20070824214001-twzxfyr522gew8u6
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Sat 2007-08-25 08:36:01 +1000
message:
  Various fixups found dogfooding.
modified:
  bzrlib/index.py                index.py-20070712131115-lolkarso50vjr64s-1
  bzrlib/repofmt/knitrepo.py     knitrepo.py-20070206081537-pyy4a00xdas0j4pf-1
  bzrlib/repofmt/pack_repo.py    pack_repo.py-20070813041115-gjv5ma7ktfqwsjgn-1
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
=== modified file 'bzrlib/index.py'
--- a/bzrlib/index.py	2007-08-24 02:18:56 +0000
+++ b/bzrlib/index.py	2007-08-24 22:36:01 +0000
@@ -324,7 +324,7 @@
             the most efficient order for the index.
         """
         if 'evil' in debug.debug_flags:
-            trace.mutter_callsite(2,
+            trace.mutter_callsite(3,
                 "iter_all_entries scales with size of history.")
         if self._nodes is None:
             self._buffer_all()
@@ -615,7 +615,7 @@
             efficient order for the index (in this case dictionary hash order).
         """
         if 'evil' in debug.debug_flags:
-            trace.mutter_callsite(2,
+            trace.mutter_callsite(3,
                 "iter_all_entries scales with size of history.")
         if self.reference_lists:
             for key, (absent, references, value) in self._nodes.iteritems():

=== modified file 'bzrlib/repofmt/knitrepo.py'
--- a/bzrlib/repofmt/knitrepo.py	2007-08-24 21:40:01 +0000
+++ b/bzrlib/repofmt/knitrepo.py	2007-08-24 22:36:01 +0000
@@ -21,8 +21,9 @@
 import md5
 
 from bzrlib import (
-        pack,
-        )
+    debug,
+    pack,
+    )
 from bzrlib.index import (
     GraphIndex,
     GraphIndexBuilder,
@@ -57,7 +58,7 @@
 import bzrlib.revision as _mod_revision
 from bzrlib.store.revision.knit import KnitRevisionStore
 from bzrlib.store.versioned import VersionedFileStore
-from bzrlib.trace import mutter, note, warning
+from bzrlib.trace import mutter, mutter_callsite, note, warning
 
 
 class _KnitParentsProvider(object):
@@ -163,7 +164,7 @@
         :return: a dictionary of revision_id->revision_parents_list.
         """
         if 'evil' in debug.debug_flags:
-            mutter_callsite(2,
+            mutter_callsite(3,
                 "get_revision_graph scales with size of history.")
         # special case NULL_REVISION
         if revision_id == _mod_revision.NULL_REVISION:
@@ -185,6 +186,9 @@
         :param revision_ids: an iterable of revisions to graph or None for all.
         :return: a Graph object with the graph reachable from revision_ids.
         """
+        if 'evil' in debug.debug_flags:
+            mutter_callsite(3,
+                "get_revision_graph_with_ghosts scales with size of history.")
         result = deprecated_graph.Graph()
         vf = self._get_revision_vf()
         versions = set(vf.versions())

=== modified file 'bzrlib/repofmt/pack_repo.py'
--- a/bzrlib/repofmt/pack_repo.py	2007-08-24 21:40:01 +0000
+++ b/bzrlib/repofmt/pack_repo.py	2007-08-24 22:36:01 +0000
@@ -206,13 +206,21 @@
         if getattr(self.repo, '_open_pack_tuple', None) is not None:
             raise errors.BzrError('call to create_pack_from_packs while '
                 'another pack is being written.')
+        if revision_ids is not None and len(revision_ids) == 0:
+            # silly fetch request.
+            return None
         random_name = self.repo.control_files._lock.nonce + suffix
         if 'fetch' in debug.debug_flags:
             plain_pack_list = ['%s%s' % (transport.base, name) for
                 transport, name in revision_index_map.itervalues()]
-            mutter('%s: create_pack: creating pack from source packs: %s%s %s t=0',
+            if revision_ids is not None:
+                rev_count = len(revision_ids)
+            else:
+                rev_count = 'all'
+            mutter('%s: create_pack: creating pack from source packs: '
+                '%s%s %s revisions wanted %s t=0',
                 time.ctime(), self.repo._upload_transport.base, random_name,
-                plain_pack_list)
+                plain_pack_list, rev_count)
             start_time = time.time()
         write_stream = self.repo._upload_transport.open_write_stream(random_name)
         if 'fetch' in debug.debug_flags:
@@ -398,8 +406,8 @@
             # XXX: the following may want to be a class, to pack with a given
             # policy.
             mutter('Packing repository %s, which has %d pack files, '
-                'containing %d revisions into %d packs.', self, total_packs,
-                total_revisions, self._max_pack_count(total_revisions))
+                'containing %d revisions into 1 packs.', self, total_packs,
+                total_revisions)
             # determine which packs need changing
             pack_distribution = [1]
             pack_operations = [[0, []]]

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2007-08-24 21:40:01 +0000
+++ b/bzrlib/repository.py	2007-08-24 22:36:01 +0000
@@ -548,7 +548,7 @@
     def has_revision(self, revision_id):
         """True if this repository has a copy of the revision."""
         if 'evil' in debug.debug_flags:
-            mutter_callsite(2, "has_revision is a LBYL symptom.")
+            mutter_callsite(3, "has_revision is a LBYL symptom.")
         revision_id = osutils.safe_revision_id(revision_id)
         return self._revision_store.has_revision_id(revision_id,
                                                     self.get_transaction())
@@ -891,7 +891,7 @@
         :return: a dictionary of revision_id->revision_parents_list.
         """
         if 'evil' in debug.debug_flags:
-            mutter_callsite(2,
+            mutter_callsite(3,
                 "get_revision_graph scales with size of history.")
         # special case NULL_REVISION
         if revision_id == _mod_revision.NULL_REVISION:
@@ -926,7 +926,7 @@
         :return: a Graph object with the graph reachable from revision_ids.
         """
         if 'evil' in debug.debug_flags:
-            mutter_callsite(2,
+            mutter_callsite(3,
                 "get_revision_graph_with_ghosts scales with size of history.")
         result = deprecated_graph.Graph()
         if not revision_ids:



More information about the bazaar-commits mailing list