~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weave.py

  • Committer: Martin Pool
  • Date: 2005-07-17 18:27:05 UTC
  • Revision ID: mbp@sourcefrog.net-20050717182705-cf3749c050950a4b
- go back to using plain builtin set()

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
"""Weave - storage of related text file versions"""
23
23
 
 
24
# before intset (r923) 2000 versions in 41.5s
 
25
# with intset (r926) 2000 versions in 93s !!!
 
26
# better to just use plain sets.
 
27
 
24
28
# TODO: Perhaps have copy method for Weave instances?
25
29
 
26
30
# XXX: If we do weaves this way, will a merge still behave the same
56
60
 
57
61
 
58
62
 
59
 
from bzrlib.intset import IntSet
60
 
 
61
 
 
62
63
 
63
64
class WeaveError(Exception):
64
65
    """Exception in processing weave"""
235
236
 
236
237
    def inclusions(self, versions):
237
238
        """Return set of all ancestors of given version(s)."""
238
 
        i = IntSet(versions)
 
239
        i = set(versions)
239
240
        v = max(versions)
240
241
        try:
241
242
            while v >= 0:
258
259
        li.sort(reverse=True)
259
260
 
260
261
        mininc = []
261
 
        gotit = IntSet()
 
262
        gotit = set()
262
263
 
263
264
        for pv in li:
264
265
            if pv not in gotit:
274
275
        if parents:
275
276
            self._v.append(parents)
276
277
        else:
277
 
            self._v.append(IntSet())
 
278
            self._v.append(set())
278
279
 
279
280
 
280
281
    def _check_lines(self, text):
318
319
        """
319
320
        
320
321
        istack = []
321
 
        dset = IntSet()
 
322
        dset = set()
322
323
 
323
324
        lineno = 0         # line of weave, 0-based
324
325
 
358
359
        included = self.inclusions(versions)
359
360
 
360
361
        istack = []
361
 
        dset = IntSet()
 
362
        dset = set()
362
363
 
363
364
        lineno = 0         # line of weave, 0-based
364
365