~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil, Patch Queue Manager, Jelmer Vernooij
  • Date: 2017-01-17 16:20:41 UTC
  • mfrom: (6619.1.2 trunk)
  • Revision ID: tarmac-20170117162041-oo62uk1qsmgc9j31
Merge 2.7 into trunk including fixes for bugs #1622039, #1644003, #1579093 and #1645017. [r=vila]

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
 
17
19
# XXX: Some consideration of the problems that might occur if there are
18
20
# files whose id differs only in case.  That should probably be forbidden.
19
21
 
20
22
 
21
 
import errno
22
23
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
32
30
from bzrlib.store import TransportStore
33
 
from bzrlib.atomicfile import AtomicFile
34
 
from bzrlib.symbol_versioning import (deprecated_method,
35
 
        )
36
31
from bzrlib.trace import mutter
37
32
import bzrlib.ui
38
33
 
44
39
    # transport factory callable?
45
40
    def __init__(self, transport, prefixed=False, precious=False,
46
41
                 dir_mode=None, file_mode=None,
47
 
                 versionedfile_class=WeaveFile,
 
42
                 versionedfile_class=None,
48
43
                 versionedfile_kwargs={},
49
44
                 escaped=False):
50
45
        super(VersionedFileStore, self).__init__(transport,
213
208
        """
214
209
        from bzrlib.transactions import PassThroughTransaction
215
210
        if from_transaction is None:
216
 
            warn("WeaveStore.copy_multi without a from_transaction parameter "
 
211
            warn("VersionedFileStore.copy_multi without a from_transaction parameter "
217
212
                 "is deprecated. Please provide a from_transaction.",
218
213
                 DeprecationWarning,
219
214
                 stacklevel=2)
220
215
            # we are reading one object - caching is irrelevant.
221
216
            from_transaction = PassThroughTransaction()
222
217
        if to_transaction is None:
223
 
            warn("WeaveStore.copy_multi without a to_transaction parameter "
 
218
            warn("VersionedFileStore.copy_multi without a to_transaction parameter "
224
219
                 "is deprecated. Please provide a to_transaction.",
225
220
                 DeprecationWarning,
226
221
                 stacklevel=2)
227
 
            # we are copying single objects, and there may be open tranasactions
 
222
            # we are copying single objects, and there may be open transactions
228
223
            # so again with the passthrough
229
224
            to_transaction = PassThroughTransaction()
230
225
        pb = bzrlib.ui.ui_factory.nested_progress_bar()
246
241
    def total_size(self):
247
242
        count, bytes =  super(VersionedFileStore, self).total_size()
248
243
        return (count / len(self._versionedfile_class.get_suffixes())), bytes
249
 
 
250
 
WeaveStore = VersionedFileStore