~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/pack_repo.py

  • Committer: Andrew Bennetts
  • Date: 2009-09-01 06:32:42 UTC
  • mto: (4634.6.23 2.0)
  • mto: This revision was merged to the branch mainline in revision 4676.
  • Revision ID: andrew.bennetts@canonical.com-20090901063242-96on706kiblvtnsf
Put new key tracking in _KeyRefs rather than alongside it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2076
2076
        if getattr(self.repo, 'chk_bytes', None) is not None:
2077
2077
            # Ensure that all inventories added in this write group have their
2078
2078
            # corresponding chk_bytes root keys present.
2079
 
            new_inventories_keys = self.repo.inventories._index._new_keys
2080
 
            rev_ids = [key[-1] for key in new_inventories_keys]
 
2079
            new_revisions_keys = self.repo.revisions._index._key_dependencies.get_new_keys()
 
2080
            rev_ids = [key[-1] for key in new_revisions_keys]
2081
2081
            for new_inv in self.repo.iter_inventories(rev_ids, 'unordered'):
2082
2082
                root_keys = set([new_inv.id_to_entry.key()])
2083
2083
                if new_inv.parent_id_basename_to_file_id is not None:
2235
2235
                    % (self._format, self.bzrdir.transport.base))
2236
2236
 
2237
2237
    def _abort_write_group(self):
2238
 
        self.revisions._index._key_dependencies.refs.clear()
2239
 
        if getattr(self.inventories._index, '_new_keys', None) is not None:
2240
 
            self.inventories._index._new_keys.clear()
 
2238
        self.revisions._index._key_dependencies.clear()
2241
2239
        self._pack_collection._abort_write_group()
2242
2240
 
2243
2241
    def _get_source(self, to_format):
2257
2255
        self._pack_collection._start_write_group()
2258
2256
 
2259
2257
    def _commit_write_group(self):
2260
 
        self.revisions._index._key_dependencies.refs.clear()
2261
 
        tokens = self._pack_collection._commit_write_group()
2262
 
        if getattr(self.inventories._index, '_new_keys', None) is not None:
2263
 
            self.inventories._index._new_keys.clear()
2264
 
        return tokens
 
2258
        hint = self._pack_collection._commit_write_group()
 
2259
        self.revisions._index._key_dependencies.clear()
 
2260
        return hint
2265
2261
 
2266
2262
    def suspend_write_group(self):
2267
2263
        # XXX check self._write_group is self.get_transaction()?
2268
2264
        tokens = self._pack_collection._suspend_write_group()
2269
 
        self.revisions._index._key_dependencies.refs.clear()
2270
 
        if getattr(self.inventories._index, '_new_keys', None) is not None:
2271
 
            self.inventories._index._new_keys.clear()
 
2265
        self.revisions._index._key_dependencies.clear()
2272
2266
        self._write_group = None
2273
2267
        return tokens
2274
2268
 
2281
2275
            raise
2282
2276
        for pack in self._pack_collection._resumed_packs:
2283
2277
            self.revisions._index.scan_unvalidated_index(pack.revision_index)
2284
 
            self.inventories._index.scan_unvalidated_index(pack.inventory_index)
2285
2278
 
2286
2279
    def get_transaction(self):
2287
2280
        if self._write_lock_count: