~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Andrew Bennetts
  • Date: 2010-10-08 08:15:14 UTC
  • mto: This revision was merged to the branch mainline in revision 5498.
  • Revision ID: andrew.bennetts@canonical.com-20101008081514-dviqzrdfwyzsqbz2
Split NEWS into per-release doc/en/release-notes/bzr-*.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
from __future__ import absolute_import
18
 
 
19
17
# XXX: Some consideration of the problems that might occur if there are
20
18
# files whose id differs only in case.  That should probably be forbidden.
21
19
 
22
20
 
 
21
import errno
23
22
import os
 
23
from cStringIO import StringIO
24
24
from warnings import warn
25
25
 
26
26
from bzrlib import (
27
27
    errors,
28
28
    osutils,
29
29
    )
 
30
from bzrlib.weavefile import read_weave, write_weave_v5
 
31
from bzrlib.weave import WeaveFile, Weave
30
32
from bzrlib.store import TransportStore
 
33
from bzrlib.atomicfile import AtomicFile
 
34
from bzrlib.symbol_versioning import (deprecated_method,
 
35
        )
31
36
from bzrlib.trace import mutter
32
37
import bzrlib.ui
33
38
 
39
44
    # transport factory callable?
40
45
    def __init__(self, transport, prefixed=False, precious=False,
41
46
                 dir_mode=None, file_mode=None,
42
 
                 versionedfile_class=None,
 
47
                 versionedfile_class=WeaveFile,
43
48
                 versionedfile_kwargs={},
44
49
                 escaped=False):
45
50
        super(VersionedFileStore, self).__init__(transport,
208
213
        """
209
214
        from bzrlib.transactions import PassThroughTransaction
210
215
        if from_transaction is None:
211
 
            warn("VersionedFileStore.copy_multi without a from_transaction parameter "
 
216
            warn("WeaveStore.copy_multi without a from_transaction parameter "
212
217
                 "is deprecated. Please provide a from_transaction.",
213
218
                 DeprecationWarning,
214
219
                 stacklevel=2)
215
220
            # we are reading one object - caching is irrelevant.
216
221
            from_transaction = PassThroughTransaction()
217
222
        if to_transaction is None:
218
 
            warn("VersionedFileStore.copy_multi without a to_transaction parameter "
 
223
            warn("WeaveStore.copy_multi without a to_transaction parameter "
219
224
                 "is deprecated. Please provide a to_transaction.",
220
225
                 DeprecationWarning,
221
226
                 stacklevel=2)
222
 
            # we are copying single objects, and there may be open transactions
 
227
            # we are copying single objects, and there may be open tranasactions
223
228
            # so again with the passthrough
224
229
            to_transaction = PassThroughTransaction()
225
230
        pb = bzrlib.ui.ui_factory.nested_progress_bar()
241
246
    def total_size(self):
242
247
        count, bytes =  super(VersionedFileStore, self).total_size()
243
248
        return (count / len(self._versionedfile_class.get_suffixes())), bytes
 
249
 
 
250
WeaveStore = VersionedFileStore