At file:///data/jelmer/bzr-svn/trunk/

------------------------------------------------------------
revno: 1876
revision-id: [EMAIL PROTECTED]
parent: [EMAIL PROTECTED]
committer: Jelmer Vernooij <[EMAIL PROTECTED]>
branch nick: trunk
timestamp: Tue 2008-09-09 02:50:59 +0200
message:
  Fix corner case corruption pulling from a svn repository that contains 
bzr-roundtripped revisions.
modified:
  NEWS                           news-20061231030336-h9fhq245ie0de8bs-1
  commit.py                      commit.py-20060607190346-qvq128wgfubhhgm2-1
=== modified file 'NEWS'
--- a/NEWS      2008-09-09 00:33:01 +0000
+++ b/NEWS      2008-09-09 00:50:59 +0000
@@ -45,6 +45,9 @@
    * Avoid leaking memory when attempting to open an invalid Subversion 
      repository. (#262513)
 
+   * Fix corner case corruption pulling from a svn repository that contains 
bzr-roundtripped 
+     revisions. (#260416)
+
   INTERNALS
 
    * Remove custom commit code for working tree. 

=== modified file 'commit.py'
--- a/commit.py 2008-09-08 22:16:22 +0000
+++ b/commit.py 2008-09-09 00:50:59 +0000
@@ -154,6 +154,7 @@
         self.push_metadata = push_metadata
         self._append_revisions_only = append_revisions_only
         self._text_parents = {}
+        self._texts = texts
 
         # Gather information about revision on top of which the commit is 
         # happening
@@ -624,10 +625,19 @@
                 accessed when the entry has a revision of None - that is when 
                 it is a candidate to commit.
         """
-        self._text_parents[ie.file_id] = []
-        for parent_inv in parent_invs:
-            if ie.file_id in parent_inv:
-                
self._text_parents[ie.file_id].append(parent_inv[ie.file_id].revision)
+        if self._texts is None or ie.revision is None:
+            self._text_parents[ie.file_id] = []
+            for parent_inv in parent_invs:
+                if ie.file_id in parent_inv:
+                    
self._text_parents[ie.file_id].append(parent_inv[ie.file_id].revision)
+        else:
+            key = (ie.file_id, ie.revision)
+            parent_map = self._texts.get_parent_map([key])
+            if ie.parent_id is None and (not key in parent_map or 
parent_map[key] is None):
+                # non-rich-root repositories don't have a text for the root
+                self._text_parents[ie.file_id] = self.parents
+            else:
+                self._text_parents[ie.file_id] = [r[1] for r in 
parent_map[key]]
         self.new_inventory.add(ie)
         assert (ie.file_id not in self.old_inv or 
                 self.old_inv[ie.file_id].revision is not None)


-- 
bazaar-commits mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/bazaar-commits

Reply via email to