~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weave.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-09-29 08:49:52 UTC
  • mfrom: (3741.2.1 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20080929084952-3d81d63rru8tt8mm
(vila) Fix python-2.6 various compatibility issues

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
from copy import copy
72
72
from cStringIO import StringIO
73
73
import os
74
 
import sha
75
74
import time
76
75
import warnings
77
76
 
86
85
        WeaveRevisionNotPresent,
87
86
        )
88
87
import bzrlib.errors as errors
89
 
from bzrlib.osutils import dirname, sha_strings, split_lines
 
88
from bzrlib.osutils import dirname, sha, sha_strings, split_lines
90
89
import bzrlib.patiencediff
91
90
from bzrlib.revision import NULL_REVISION
92
91
from bzrlib.symbol_versioning import *
215
214
 
216
215
    __slots__ = ['_weave', '_parents', '_sha1s', '_names', '_name_map',
217
216
                 '_weave_name', '_matcher', '_allow_reserved']
218
 
    
 
217
 
219
218
    def __init__(self, weave_name=None, access_mode='w', matcher=None,
220
219
                 get_scope=None, allow_reserved=False):
221
220
        """Create a weave.
224
223
            for detecting when this weave goes out of scope (should stop
225
224
            answering requests or allowing mutation).
226
225
        """
227
 
        super(Weave, self).__init__(access_mode)
 
226
        super(Weave, self).__init__()
228
227
        self._weave = []
229
228
        self._parents = []
230
229
        self._sha1s = []
799
798
            # For creating the ancestry, IntSet is much faster (3.7s vs 0.17s)
800
799
            # The problem is that set membership is much more expensive
801
800
            name = self._idx_to_name(i)
802
 
            sha1s[name] = sha.new()
 
801
            sha1s[name] = sha()
803
802
            texts[name] = []
804
803
            new_inc = set([name])
805
804
            for p in self._parents[i]: