Rev 3861: Handle some cases of dubious inventory data (like john at arbash-meinel.com-20051123154424-a02f8bf990a1fed5) in http://people.ubuntu.com/~robertc/baz2.0/repository

Robert Collins robertc at robertcollins.net
Sun Mar 8 23:35:03 GMT 2009


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

------------------------------------------------------------
revno: 3861
revision-id: robertc at robertcollins.net-20090308233501-6w6qg39ljs06wvk2
parent: ian.clatworthy at canonical.com-20090307135530-7qh6scyx11tm33yz
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository
timestamp: Mon 2009-03-09 10:35:01 +1100
message:
  Handle some cases of dubious inventory data (like john at arbash-meinel.com-20051123154424-a02f8bf990a1fed5)
=== modified file 'bzrlib/commands.py'
--- a/bzrlib/commands.py	2009-02-23 15:42:47 +0000
+++ b/bzrlib/commands.py	2009-03-08 23:35:01 +0000
@@ -941,7 +941,7 @@
                 p.setup(tb.tb_frame, tb)
                 # Point the debugger at the deepest frame of the stack
                 p.curindex = len(p.stack) - 1
-                p.curframe = p.stack[p.curindex]
+                p.curframe = p.stack[p.curindex][0]
                 # Start the pdb prompt.
                 p.print_stack_entry(p.stack[p.curindex])
                 p.execRcLines()

=== modified file 'bzrlib/repository.py'
--- a/bzrlib/repository.py	2009-03-07 06:42:07 +0000
+++ b/bzrlib/repository.py	2009-03-08 23:35:01 +0000
@@ -3369,6 +3369,10 @@
         pending_deltas = []
         pending_revisions = []
         parent_map = self.source.get_parent_map(revision_ids)
+        # NB: This fails with dubious inventory data (when inv A has rev OLD
+        # for file F, and in B, after A, has rev A for file F) when A and B are
+        # in different groups.
+        revision_id_set = set(revision_ids)
         for tree in self.source.revision_trees(revision_ids):
             current_revision_id = tree.get_revision_id()
             parent_ids = parent_map.get(current_revision_id, ())
@@ -3381,9 +3385,7 @@
                         # We don't copy the text for the root node unless the
                         # target supports_rich_root.
                         continue
-                    # TODO: Do we need:
-                    #       "if entry.revision == current_revision_id" ?
-                    if entry.revision == current_revision_id:
+                    if entry.revision in revision_id_set:
                         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