317
317
from bzrlib.xml import pack_xml
318
318
from cStringIO import StringIO
320
self._transport.mkdir(self._rel_controlfilename([]))
321
self._transport.put(self._rel_controlfilename('README'),
320
# Create an empty inventory to store
322
pack_xml(Inventory(), sio)
324
dirs = [[], 'text-store', 'inventory-store', 'revision-store']
322
326
"This is a Bazaar-NG control directory.\n"
323
"Do not change any files in this directory.\n")
324
self._transport.put(self._rel_controlfilename('branch-format'),
326
for d in ('text-store', 'inventory-store', 'revision-store'):
327
self._transport.mkdir(self._rel_controlfilename(d))
328
for f in ('revision-history', 'merged-patches',
329
'pending-merged-patches', 'branch-name',
332
self._transport.put(self._rel_controlfilename(f), '')
327
"Do not change any files in this directory.\n"),
328
('branch-format', BZR_BRANCH_FORMAT),
329
('revision-history', ''),
330
('merged-patches', ''),
331
('pending-merged-patches', ''),
334
('pending-merges', ''),
335
('inventory', sio.getvalue())
337
self._transport.mkdir_multi([self._rel_controlfilename(d) for d in dirs])
338
self._transport.put_multi([(self._rel_controlfilename(f[0]),f[1]) for f in files])
333
339
mutter('created control directory in ' + self._transport.base)
335
# TODO: Try and do this with self._transport.put() instead
337
pack_xml(Inventory(), sio)
339
self.put_controlfile('inventory', sio, encode=False)
342
341
def _check_format(self):
343
342
"""Check this branch format is supported.