~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/bundle_data.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-05-04 03:45:56 UTC
  • mfrom: (2476.2.1 install_bundle_performance)
  • Revision ID: pqm@pqm.ubuntu.com-20070504034556-wzcw478l7qkppkq0
(John Arbash Meinel) make 'install_bundle' significantly faster by only validating the revisions 1 time, rather than validating all revisions n times.

Show diffs side-by-side

added added

removed removed

Lines of Context:
109
109
        self.timestamp = None
110
110
        self.timezone = None
111
111
 
 
112
        # Have we checked the repository yet?
 
113
        self._validated_revisions_against_repo = False
 
114
 
112
115
    def __str__(self):
113
116
        return pprint.pformat(self.__dict__)
114
117
 
180
183
        revision = self.get_revision(revision_id)
181
184
        base = self.get_base(revision)
182
185
        assert base != revision_id
183
 
        self._validate_references_from_repository(repository)
 
186
        if not self._validated_revisions_against_repo:
 
187
            self._validate_references_from_repository(repository)
184
188
        revision_info = self.get_revision_info(revision_id)
185
189
        inventory_revision_id = revision_id
186
190
        bundle_tree = BundleTree(repository.revision_tree(base), 
262
266
            warning('Not all revision hashes could be validated.'
263
267
                    ' Unable validate %d hashes' % len(missing))
264
268
        mutter('Verified %d sha hashes for the bundle.' % count)
 
269
        self._validated_revisions_against_repo = True
265
270
 
266
271
    def _validate_inventory(self, inv, revision_id):
267
272
        """At this point we should have generated the BundleTree,