~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-07-01 04:21:23 UTC
  • mfrom: (3350.8.14 stacking-knits)
  • Revision ID: pqm@pqm.ubuntu.com-20080701042123-zcmqzb7o6znwjx34
(robertc) Teach KnitVersionedFiles how to stack on other
        VersionedFile objects. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
472
472
 
473
473
    def _check(self, checker, tree_revision_id, tree):
474
474
        """See InventoryEntry._check"""
475
 
        t = (self.file_id, self.revision)
476
 
        if t in checker.checked_texts:
477
 
            prev_sha = checker.checked_texts[t]
 
475
        key = (self.file_id, self.revision)
 
476
        if key in checker.checked_texts:
 
477
            prev_sha = checker.checked_texts[key]
478
478
            if prev_sha != self.text_sha1:
479
479
                raise BzrCheckError(
480
480
                    'mismatched sha1 on {%s} in {%s} (%s != %s) %r' %
489
489
        # We can't check the length, because Weave doesn't store that
490
490
        # information, and the whole point of looking at the weave's
491
491
        # sha1sum is that we don't have to extract the text.
492
 
        if (self.text_sha1 !=
493
 
            tree._repository.texts.get_sha1s([(self.file_id, self.revision)])[0]):
494
 
            raise BzrCheckError('text {%s} version {%s} wrong sha1' 
495
 
                                % (self.file_id, self.revision))
496
 
        checker.checked_texts[t] = self.text_sha1
 
492
        if (self.text_sha1 != tree._repository.texts.get_sha1s([key])[key]):
 
493
            raise BzrCheckError('text {%s} version {%s} wrong sha1' % key)
 
494
        checker.checked_texts[key] = self.text_sha1
497
495
 
498
496
    def copy(self):
499
497
        other = InventoryFile(self.file_id, self.name, self.parent_id)