~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weave.py

Whitespace and other formatting cleanups suggested by Robert.

Show diffs side-by-side

added added

removed removed

Lines of Context:
556
556
        """Yield lines for the specified version."""
557
557
        incls = [self.maybe_lookup(name_or_index)]
558
558
        if len(incls) == 1:
559
 
            index= incls[0]
560
 
            s = sha.new()
 
559
            index = incls[0]
 
560
            cur_sha = sha.new()
561
561
        else:
562
562
            # We don't have sha1 sums for multiple entries
563
 
            s = None
 
563
            cur_sha = None
564
564
        for origin, lineno, line in self._extract(incls):
565
 
            if s:
566
 
                s.update(line)
 
565
            if cur_sha:
 
566
                cur_sha.update(line)
567
567
            yield line
568
 
        if s:
 
568
        if cur_sha:
569
569
            expected_sha1 = self._sha1s[index]
570
 
            measured_sha1 = s.hexdigest() 
 
570
            measured_sha1 = cur_sha.hexdigest() 
571
571
            if measured_sha1 != expected_sha1:
572
572
                raise errors.WeaveInvalidChecksum(
573
573
                        'file %s, revision %s, expected: %s, measured %s'