~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

[merge] Storage filename escaping

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()
226
228
        self.copy_content_into(result, revision_id, basis)
227
229
        return result
228
230
 
 
231
    # XXX: Is this actually called?
 
232
    @needs_read_lock
 
233
    def copy(self, destination):
 
234
        raise NotImplementedError("Repository.copy() no longer required?")
 
235
        destination.lock_write()
 
236
        try:
 
237
            copy_all(self.weave_store, destination.weave_store)
 
238
            note('copying inventories')
 
239
            destination.control_weaves.copy_multi(self.control_weaves,
 
240
                ['inventory'])
 
241
            copy_all(self.revision_store, destination.revision_store)
 
242
        finally:
 
243
            destination.unlock()
 
244
 
229
245
    @needs_read_lock
230
246
    def has_revision(self, revision_id):
231
247
        """True if this repository has a copy of the revision."""