Rev 6077: Merge tip of bzr/2.4 in http://bazaar.launchpad.net/~jameinel/bzr/2.4-fdatasync-ENOTSUP-1075108

John Arbash Meinel john at arbash-meinel.com
Thu May 23 08:28:27 UTC 2013


At http://bazaar.launchpad.net/~jameinel/bzr/2.4-fdatasync-ENOTSUP-1075108

------------------------------------------------------------
revno: 6077 [merge]
revision-id: john at arbash-meinel.com-20130523082827-b1wlrb8bpkngfhu3
parent: john at arbash-meinel.com-20130523082507-n5cv7q11uemvkaii
parent: pqm at pqm.ubuntu.com-20130523081746-2bsarcuxk0ihst5s
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.4-fdatasync-ENOTSUP-1075108
timestamp: Thu 2013-05-23 09:28:27 +0100
message:
  Merge tip of bzr/2.4
modified:
  bzrlib/dirstate.py             dirstate.py-20060728012006-d6mvoihjb3je9peu-1
-------------- next part --------------
=== modified file 'bzrlib/dirstate.py'
--- a/bzrlib/dirstate.py	2011-09-28 15:41:38 +0000
+++ b/bzrlib/dirstate.py	2013-05-19 11:45:42 +0000
@@ -2609,13 +2609,6 @@
         self.update_minimal(('', '', new_id), 'd',
             path_utf8='', packed_stat=entry[1][0][4])
         self._mark_modified()
-        # XXX: This was added by Ian, we need to make sure there
-        #      are tests for it, because it isn't in bzr.dev TRUNK
-        #      It looks like the only place it is called is in setting the root
-        #      id of the tree. So probably we never had an _id_index when we
-        #      don't even have a root yet.
-        if self._id_index is not None:
-            self._add_to_id_index(self._id_index, entry[0])
 
     def set_parent_trees(self, trees, ghosts):
         """Set the parent trees for the dirstate.
@@ -3328,10 +3321,20 @@
         if self._id_index is not None:
             for file_id, entry_keys in self._id_index.iteritems():
                 for entry_key in entry_keys:
+                    # Check that the entry in the map is pointing to the same
+                    # file_id
                     if entry_key[2] != file_id:
                         raise AssertionError(
                             'file_id %r did not match entry key %s'
                             % (file_id, entry_key))
+                    # And that from this entry key, we can look up the original
+                    # record
+                    block_index, present = self._find_block_index_from_key(entry_key)
+                    if not present:
+                        raise AssertionError('missing block for entry key: %r', entry_key)
+                    entry_index, present = self._find_entry_index(entry_key, self._dirblocks[block_index][1])
+                    if not present:
+                        raise AssertionError('missing entry for key: %r', entry_key)
                 if len(entry_keys) != len(set(entry_keys)):
                     raise AssertionError(
                         'id_index contained non-unique data for %s'



More information about the bazaar-commits mailing list