~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/store/versioned/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2011-05-11 11:35:28 UTC
  • mto: This revision was merged to the branch mainline in revision 5851.
  • Revision ID: john@arbash-meinel.com-20110511113528-qepibuwxicjrbb2h
Break compatibility with python <2.6.

This includes auditing the code for places where we were doing
explicit 'sys.version' checks and removing them as appropriate.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
# files whose id differs only in case.  That should probably be forbidden.
19
19
 
20
20
 
21
 
import errno
22
21
import os
23
 
from cStringIO import StringIO
24
22
from warnings import warn
25
23
 
26
24
from bzrlib import (
27
25
    errors,
28
26
    osutils,
29
27
    )
30
 
from bzrlib.weavefile import read_weave, write_weave_v5
31
 
from bzrlib.weave import WeaveFile, Weave
32
28
from bzrlib.store import TransportStore
33
 
from bzrlib.atomicfile import AtomicFile
34
 
from bzrlib.symbol_versioning import (deprecated_method,
35
 
        )
36
29
from bzrlib.trace import mutter
37
30
import bzrlib.ui
38
31
 
44
37
    # transport factory callable?
45
38
    def __init__(self, transport, prefixed=False, precious=False,
46
39
                 dir_mode=None, file_mode=None,
47
 
                 versionedfile_class=WeaveFile,
 
40
                 versionedfile_class=None,
48
41
                 versionedfile_kwargs={},
49
42
                 escaped=False):
50
43
        super(VersionedFileStore, self).__init__(transport,
213
206
        """
214
207
        from bzrlib.transactions import PassThroughTransaction
215
208
        if from_transaction is None:
216
 
            warn("WeaveStore.copy_multi without a from_transaction parameter "
 
209
            warn("VersionedFileStore.copy_multi without a from_transaction parameter "
217
210
                 "is deprecated. Please provide a from_transaction.",
218
211
                 DeprecationWarning,
219
212
                 stacklevel=2)
220
213
            # we are reading one object - caching is irrelevant.
221
214
            from_transaction = PassThroughTransaction()
222
215
        if to_transaction is None:
223
 
            warn("WeaveStore.copy_multi without a to_transaction parameter "
 
216
            warn("VersionedFileStore.copy_multi without a to_transaction parameter "
224
217
                 "is deprecated. Please provide a to_transaction.",
225
218
                 DeprecationWarning,
226
219
                 stacklevel=2)
246
239
    def total_size(self):
247
240
        count, bytes =  super(VersionedFileStore, self).total_size()
248
241
        return (count / len(self._versionedfile_class.get_suffixes())), bytes
249
 
 
250
 
WeaveStore = VersionedFileStore