~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-04-12 08:40:15 UTC
  • mfrom: (1651.1.7 bzr.mbp.escape-stores)
  • Revision ID: pqm@pqm.ubuntu.com-20060412084015-e6472a0717edbca6
(mbp) storage escaping, cleanups

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
from bzrlib.store.versioned import VersionedFileStore, WeaveStore
34
34
from bzrlib.store.text import TextStore
35
35
from bzrlib.symbol_versioning import *
36
 
from bzrlib.trace import mutter
 
36
from bzrlib.trace import mutter, note
37
37
from bzrlib.tree import RevisionTree
38
38
from bzrlib.tsort import topo_sort
39
39
from bzrlib.testament import Testament
96
96
            else:
97
97
                # yes, this is not suitable for adding with ghosts.
98
98
                self.add_inventory(rev_id, inv, rev.parent_ids)
99
 
        self._revision_store.add_revision(rev, self.get_transaction())   
 
99
        self._revision_store.add_revision(rev, self.get_transaction())
100
100
 
101
101
    @needs_read_lock
102
102
    def _all_possible_ids(self):
143
143
        getting file texts, inventories and revisions, then
144
144
        this construct will accept instances of those things.
145
145
        """
146
 
        object.__init__(self)
 
146
        super(Repository, self).__init__()
147
147
        self._format = _format
148
148
        # the following are part of the public API for Repository:
149
149
        self.bzrdir = a_bzrdir
156
156
        # 
157
157
        self.control_store = control_store
158
158
        self.control_weaves = control_store
 
159
        # TODO: make sure to construct the right store classes, etc, depending
 
160
        # on whether escaping is required.
159
161
 
160
162
    def lock_write(self):
161
163
        self.control_files.lock_write()
909
911
                                  transport,
910
912
                                  control_files,
911
913
                                  prefixed=True,
912
 
                                  versionedfile_class=WeaveFile):
 
914
                                  versionedfile_class=WeaveFile,
 
915
                                  escaped=False):
913
916
        weave_transport = control_files._transport.clone(name)
914
917
        dir_mode = control_files._dir_mode
915
918
        file_mode = control_files._file_mode
916
919
        return VersionedFileStore(weave_transport, prefixed=prefixed,
917
 
                                dir_mode=dir_mode,
918
 
                                file_mode=file_mode,
919
 
                                versionedfile_class=versionedfile_class)
 
920
                                  dir_mode=dir_mode,
 
921
                                  file_mode=file_mode,
 
922
                                  versionedfile_class=versionedfile_class,
 
923
                                  escaped=escaped)
920
924
 
921
925
    def initialize(self, a_bzrdir, shared=False):
922
926
        """Initialize a repository of this format in a_bzrdir.
1279
1283
     - an optional 'shared-storage' flag
1280
1284
     - an optional 'no-working-trees' flag
1281
1285
     - a LockDir lock
 
1286
 
 
1287
    This format was introduced in bzr 0.8.
1282
1288
    """
1283
1289
 
1284
1290
    def _get_control_store(self, repo_transport, control_files):
1304
1310
        from bzrlib.store.revision.knit import KnitRevisionStore
1305
1311
        versioned_file_store = VersionedFileStore(
1306
1312
            repo_transport,
1307
 
            file_mode = control_files._file_mode,
 
1313
            file_mode=control_files._file_mode,
1308
1314
            prefixed=False,
1309
1315
            precious=True,
1310
1316
            versionedfile_class=KnitVersionedFile,
1311
 
            versionedfile_kwargs={'delta':False, 'factory':KnitPlainFactory()})
 
1317
            versionedfile_kwargs={'delta':False, 'factory':KnitPlainFactory()},
 
1318
            escaped=True,
 
1319
            )
1312
1320
        return KnitRevisionStore(versioned_file_store)
1313
1321
 
1314
1322
    def _get_text_store(self, transport, control_files):
1316
1324
        return self._get_versioned_file_store('knits',
1317
1325
                                              transport,
1318
1326
                                              control_files,
1319
 
                                              versionedfile_class=KnitVersionedFile)
 
1327
                                              versionedfile_class=KnitVersionedFile,
 
1328
                                              escaped=True)
1320
1329
 
1321
1330
    def initialize(self, a_bzrdir, shared=False):
1322
1331
        """Create a knit format 1 repository.