Rev 4006: Related to bug #328674, give a better error for a corrupt dirstate. in http://bzr.arbash-meinel.com/branches/bzr/jam-integration

John Arbash Meinel john at arbash-meinel.com
Thu Feb 12 18:56:10 GMT 2009


At http://bzr.arbash-meinel.com/branches/bzr/jam-integration

------------------------------------------------------------
revno: 4006
revision-id: john at arbash-meinel.com-20090212185516-wwdbov5nb7fxat8r
parent: pqm at pqm.ubuntu.com-20090212154913-cleqwmh36ss3gswk
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: jam-integration
timestamp: Thu 2009-02-12 12:55:16 -0600
message:
  Related to bug #328674, give a better error for a corrupt dirstate.
-------------- next part --------------
=== modified file 'bzrlib/_dirstate_helpers_c.pyx'
--- a/bzrlib/_dirstate_helpers_c.pyx	2008-10-04 17:01:00 +0000
+++ b/bzrlib/_dirstate_helpers_c.pyx	2009-02-12 18:55:16 +0000
@@ -1256,8 +1256,14 @@
             path = self.pathjoin(entry[0][0], entry[0][1])
             # parent id is the entry for the path in the target tree
             # TODO: these are the same for an entire directory: cache em.
-            parent_id = self.state._get_entry(self.target_index,
-                                         path_utf8=entry[0][0])[0][2]
+            parent_entry = self.state._get_entry(self.target_index,
+                                                 path_utf8=entry[0][0])
+            if parent_entry is None:
+                raise errors.DirstateCorrupt(self.state,
+                    "We could not find the parent entry in index %d"
+                    " for the entry: %s"
+                    % (self.target_index, entry[0]))
+            parent_id = parent_entry[0][2]
             if parent_id == entry[0][2]:
                 parent_id = None
             if path_info is not None:



More information about the bazaar-commits mailing list