~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weave.py

  • Committer: Martin Pool
  • Date: 2005-08-24 02:34:24 UTC
  • Revision ID: mbp@sourcefrog.net-20050824023424-67667e2b57c3d7d0
- merge test refactoring from robertc

  More of the common test infrastructure to do with 
  making temporary directories, etc, is now done from a 
  TestCase subclass, and generally have less magic
  compared to unittest. 

robertc@robertcollins.net-20050823111339-fb55b8ce170b20e0

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
 
88
88
 
89
89
import sha
90
 
from cStringIO import StringIO
 
90
 
91
91
 
92
92
 
93
93
class WeaveError(Exception):
451
451
 
452
452
        The set typically but not necessarily corresponds to a version.
453
453
        """
454
 
        for i in versions:
455
 
            if not isinstance(i, int):
456
 
                raise ValueError(i)
457
 
            
458
454
        included = self.inclusions(versions)
459
455
 
460
456
        istack = []
511
507
            yield line
512
508
 
513
509
 
514
 
    def get_text(self, version):
515
 
        assert isinstance(version, int)
516
 
        s = StringIO()
517
 
        s.writelines(self.get_iter(version))
518
 
        return s.getvalue()
519
 
 
520
 
 
521
510
    def get(self, index):
522
511
        return list(self.get_iter(index))
523
512