~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tools/testweave.py

  • Committer: Martin Pool
  • Date: 2005-07-17 17:53:39 UTC
  • mfrom: (909.1.5)
  • Revision ID: mbp@sourcefrog.net-20050717175339-9433d3dc4d9d3b5c
- Add IntSet class

- Start converting weave calculation to use it

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
from bzrlib.weave import Weave, WeaveFormatError
27
27
from bzrlib.weavefile import write_weave, read_weave
28
28
from pprint import pformat
29
 
 
 
29
from bzrlib.intset import IntSet
30
30
 
31
31
 
32
32
try:
118
118
                          ('}', 0),
119
119
                          ])
120
120
 
121
 
        changes = list(k._delta(set([0]),
 
121
        changes = list(k._delta(IntSet([0]),
122
122
                                ['line 1',
123
123
                                 'new line']))
124
124
 
522
522
                         ["first line",
523
523
                          "alternative second line"])
524
524
 
525
 
        self.assertEqual(k.inclusions([2]),
526
 
                         set([0, 2]))
 
525
        self.assertEqual(list(k.inclusions([2])),
 
526
                         [0, 2])
527
527
 
528
528
 
529
529
 
571
571
                          (2, 'line from 2'),
572
572
                          ])
573
573
 
574
 
        self.assertEqual(k.inclusions([3]),
575
 
                         set([0, 1, 2, 3]))
 
574
        self.assertEqual(list(k.inclusions([3])),
 
575
                         [0, 1, 2, 3])
576
576
 
577
577
        self.log('k._l=' + pformat(k._l))
578
578