Rev 3765: Untested code is broken code. in http://people.ubuntu.com/~robertc/baz2.0/repository

Robert Collins robertc at robertcollins.net
Wed Nov 12 09:19:10 GMT 2008


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

------------------------------------------------------------
revno: 3765
revision-id: robertc at robertcollins.net-20081112091906-dcbbp5hkfopz30je
parent: robertc at robertcollins.net-20081112072357-wutucalne8hi5q1p
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Wed 2008-11-12 20:19:06 +1100
message:
  Untested code is broken code.
modified:
  BRANCH.TODO                    BRANCH.TODO-20060103052123-79ac4969351c03a9
  bzrlib/chk_map.py              chk_map.py-20081001014447-ue6kkuhofvdecvxa-1
  bzrlib/repository.py           rev_storage.py-20051111201905-119e9401e46257e3
=== modified file 'BRANCH.TODO'
--- a/BRANCH.TODO	2008-07-03 04:03:02 +0000
+++ b/BRANCH.TODO	2008-11-12 09:19:06 +0000
@@ -3,3 +3,7 @@
 # 
 #
 
+Make sure that dev3 handles the rich root correctly. That is that upgrades set
+the new value correctly and that commits to a non-rich-root followed by
+deserialisation show the root as having changed, diffs between non rich root
+revisions should not? show the root as changing?

=== modified file 'bzrlib/chk_map.py'
--- a/bzrlib/chk_map.py	2008-11-12 04:17:01 +0000
+++ b/bzrlib/chk_map.py	2008-11-12 09:19:06 +0000
@@ -461,6 +461,7 @@
             # child may have shrunk, or might be the same.
             self._len = self._len - old_len + len(child)
             self._items[serialised_key] = child
+            self._key = None
             return self.unique_serialised_prefix(), [("", self)]
         # child has overflown - create a new intermediate node.
         # XXX: This is where we might want to try and expand our depth
@@ -470,6 +471,7 @@
         for split, node in node_details:
             child.add_node(split, node)
         self._len = self._len - old_len + len(child)
+        self._key = None
         return self.unique_serialised_prefix(), [("", self)]
 
     def _new_child(self, serialised_key, klass):
@@ -583,6 +585,7 @@
         if len(self._items) == 1:
             # this node is no longer needed:
             return self._items.values()[0]
+        self._key = None
         return self
 
 

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2008-11-12 04:17:01 +0000
+++ b/bzrlib/repository.py	2008-11-12 09:19:06 +0000
@@ -3263,7 +3263,12 @@
                         delta = _make_inv_delta(basis_tree.inventory,
                             tree.inventory)
                         for old_path, new_path, file_id, entry in delta:
-                            if new_path:
+                            if new_path is not None:
+                                if not (new_path or self.target.supports_rich_root()):
+                                    # We leave the inventory delta in, because that
+                                    # will have the deserialised inventory root
+                                    # pointer.
+                                    continue
                                 text_keys.add((file_id, entry.revision))
                         revision = self.source.get_revision(current_revision_id)
                         pending_deltas.append((basis_id, delta,




More information about the bazaar-commits mailing list