~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/serializer/v08.py

  • Committer: Aaron Bentley
  • Date: 2006-09-21 18:14:14 UTC
  • mto: This revision was merged to the branch mainline in revision 2048.
  • Revision ID: abentley@panoramicfeedback.com-20060921181414-f913391df42bffaf
Bundle 0.9 uses Testament 3 strict

Show diffs side-by-side

added added

removed removed

Lines of Context:
188
188
            last_rev_id = base_id
189
189
            last_rev_tree = base_tree
190
190
 
 
191
    def _testament_sha1(self, revision_id):
 
192
        return StrictTestament.from_revision(self.source, 
 
193
                                             revision_id).as_sha1()
 
194
 
191
195
    def _write_revision(self, rev, rev_tree, base_rev, base_tree, 
192
196
                        explicit_base, force_binary):
193
197
        """Write out the information for a revision."""
202
206
        self._write_delta(rev_tree, base_tree, rev.revision_id, force_binary)
203
207
 
204
208
        w('revision id', rev.revision_id)
205
 
        w('sha1', StrictTestament.from_revision(self.source, 
206
 
                                                rev.revision_id).as_sha1())
 
209
        w('sha1', self._testament_sha1(rev.revision_id))
207
210
        w('inventory sha1', rev.inventory_sha1)
208
211
        if rev.parent_ids:
209
212
            w('parent ids', rev.parent_ids)
322
325
        self.from_file = iter(from_file)
323
326
        self._next_line = None
324
327
        
325
 
        self.info = BundleInfo08()
 
328
        self.info = self._get_info()
326
329
        # We put the actual inventory ids in the footer, so that the patch
327
330
        # is easier to read for humans.
328
331
        # Unfortunately, that means we need to read everything before we
330
333
        self._read()
331
334
        self._validate()
332
335
 
 
336
    def _get_info(self):
 
337
        return BundleInfo08()
 
338
 
333
339
    def _read(self):
334
340
        self._next().next()
335
341
        while self._next_line is not None:
508
514
 
509
515
 
510
516
class BundleInfo08(BundleInfo):
 
517
 
511
518
    def _update_tree(self, bundle_tree, revision_id):
512
519
        bundle_tree.note_last_changed('', revision_id)
513
520
        BundleInfo._update_tree(self, bundle_tree, revision_id)
 
521
 
 
522
    def _testament_sha1_from_revision(self, repository, revision_id):
 
523
        testament = StrictTestament.from_revision(repository, revision_id)
 
524
        return testament.as_sha1()
 
525
 
 
526
    def _testament_sha1(self, revision, inventory):
 
527
        return StrictTestament(revision, inventory).as_sha1()