~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/weave.py

  • Committer: Andrew Bennetts
  • Date: 2008-10-01 05:40:45 UTC
  • mfrom: (3753 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3756.
  • Revision ID: andrew.bennetts@canonical.com-20081001054045-z50qc0d3p9qsc5im
Merge from bzr.dev; resolve osutils.py conflict by reverting my sha import hackery.

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
 
90
89
        WeaveRevisionNotPresent,
91
90
        )
92
91
import bzrlib.errors as errors
93
 
from bzrlib.osutils import dirname, sha_strings, split_lines
 
92
from bzrlib.osutils import dirname, sha, sha_strings, split_lines
94
93
import bzrlib.patiencediff
95
94
from bzrlib.revision import NULL_REVISION
96
95
from bzrlib.symbol_versioning import *
218
217
 
219
218
    __slots__ = ['_weave', '_parents', '_sha1s', '_names', '_name_map',
220
219
                 '_weave_name', '_matcher', '_allow_reserved']
221
 
    
 
220
 
222
221
    def __init__(self, weave_name=None, access_mode='w', matcher=None,
223
222
                 get_scope=None, allow_reserved=False):
224
223
        """Create a weave.
227
226
            for detecting when this weave goes out of scope (should stop
228
227
            answering requests or allowing mutation).
229
228
        """
230
 
        super(Weave, self).__init__(access_mode)
 
229
        super(Weave, self).__init__()
231
230
        self._weave = []
232
231
        self._parents = []
233
232
        self._sha1s = []
802
801
            # For creating the ancestry, IntSet is much faster (3.7s vs 0.17s)
803
802
            # The problem is that set membership is much more expensive
804
803
            name = self._idx_to_name(i)
805
 
            sha1s[name] = sha.new()
 
804
            sha1s[name] = sha()
806
805
            texts[name] = []
807
806
            new_inc = set([name])
808
807
            for p in self._parents[i]: