/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/weaverepo.py

Update to bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
62
62
 
63
63
    def __init__(self, _format, a_bzrdir):
64
64
        # we reuse one control files instance.
65
 
        dir_mode = a_bzrdir._control_files._dir_mode
66
 
        file_mode = a_bzrdir._control_files._file_mode
 
65
        dir_mode = a_bzrdir._get_dir_mode()
 
66
        file_mode = a_bzrdir._get_file_mode()
67
67
 
68
68
        def get_store(name, compressed=True, prefixed=False):
69
69
            # FIXME: This approach of assuming stores are all entirely compressed
71
71
            # some existing branches where there's a mixture; we probably 
72
72
            # still want the option to look for both.
73
73
            relpath = a_bzrdir._control_files._escape(name)
74
 
            store = TextStore(a_bzrdir._control_files._transport.clone(relpath),
 
74
            store = TextStore(a_bzrdir.transport.clone(relpath),
75
75
                              prefixed=prefixed, compressed=compressed,
76
76
                              dir_mode=dir_mode,
77
77
                              file_mode=file_mode)
266
266
        empty_weave = sio.getvalue()
267
267
 
268
268
        mutter('creating repository in %s.', a_bzrdir.transport.base)
269
 
        dirs = ['revision-store', 'weaves']
270
 
        files = [('inventory.weave', StringIO(empty_weave)),
271
 
                 ]
272
269
        
273
270
        # FIXME: RBC 20060125 don't peek under the covers
274
271
        # NB: no need to escape relative paths that are url safe.
275
272
        control_files = lockable_files.LockableFiles(a_bzrdir.transport,
276
 
                                'branch-lock', lockable_files.TransportLock)
 
273
            'branch-lock', lockable_files.TransportLock)
277
274
        control_files.create_lock()
278
275
        control_files.lock_write()
279
 
        control_files._transport.mkdir_multi(dirs,
280
 
                mode=control_files._dir_mode)
 
276
        transport = a_bzrdir.transport
281
277
        try:
282
 
            for file, content in files:
283
 
                control_files.put(file, content)
 
278
            transport.mkdir_multi(['revision-store', 'weaves'],
 
279
                mode=a_bzrdir._get_dir_mode())
 
280
            transport.put_bytes_non_atomic('inventory.weave', empty_weave)
284
281
        finally:
285
282
            control_files.unlock()
286
283
        return self.open(a_bzrdir, _found=True)