~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/bundle_data.py

  • Committer: John Arbash Meinel
  • Date: 2007-05-03 16:42:30 UTC
  • mto: This revision was merged to the branch mainline in revision 2481.
  • Revision ID: john@arbash-meinel.com-20070503164230-y0411liq6w3bphj0
Vastly improve bundle install performance by only validating the bundle one time

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,