69
69
"""See RepositoryFormat.get_format_string()."""
70
70
return "Sample .bzr repository format."
72
def initialize(self, a_bzrdir):
72
def initialize(self, a_bzrdir, shared=False):
73
73
"""Initialize a repository in a BzrDir"""
74
74
t = a_bzrdir.get_repository_transport(self)
75
75
t.put('format', StringIO(self.get_format_string()))
162
162
t.get('inventory.weave').read())
164
def test_shared_disk_layout(self):
165
control = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
166
repo = repository.RepositoryFormat7().initialize(control, shared=True)
168
# format 'Bazaar-NG Repository format 7'
170
# inventory.weave == empty_weave
171
# empty revision-store directory
172
# empty weaves directory
173
# a 'shared-storage' marker file.
174
t = control.get_repository_transport(None)
175
self.assertEqualDiff('Bazaar-NG Repository format 7',
176
t.get('format').read())
177
self.assertEqualDiff('', t.get('lock').read())
178
self.assertEqualDiff('', t.get('shared-storage').read())
179
self.assertTrue(S_ISDIR(t.stat('revision-store').st_mode))
180
self.assertTrue(S_ISDIR(t.stat('weaves').st_mode))
181
self.assertEqualDiff('# bzr weave file v5\n'
184
t.get('inventory.weave').read())
186
def test_shared_no_tree_disk_layout(self):
187
control = bzrdir.BzrDirMetaFormat1().initialize(self.get_url())
188
repo = repository.RepositoryFormat7().initialize(control, shared=True)
189
repo.set_make_working_trees(False)
191
# format 'Bazaar-NG Repository format 7'
193
# inventory.weave == empty_weave
194
# empty revision-store directory
195
# empty weaves directory
196
# a 'shared-storage' marker file.
197
t = control.get_repository_transport(None)
198
self.assertEqualDiff('Bazaar-NG Repository format 7',
199
t.get('format').read())
200
self.assertEqualDiff('', t.get('lock').read())
201
self.assertEqualDiff('', t.get('shared-storage').read())
202
self.assertEqualDiff('', t.get('no-working-trees').read())
203
repo.set_make_working_trees(True)
204
self.assertFalse(t.has('no-working-trees'))
205
self.assertTrue(S_ISDIR(t.stat('revision-store').st_mode))
206
self.assertTrue(S_ISDIR(t.stat('weaves').st_mode))
207
self.assertEqualDiff('# bzr weave file v5\n'
210
t.get('inventory.weave').read())