~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Robert Collins
  • Date: 2006-03-01 08:40:35 UTC
  • mto: (1594.2.4 integration)
  • mto: This revision was merged to the branch mainline in revision 1596.
  • Revision ID: robertc@robertcollins.net-20060301084035-ce00abd11fe4da31
Change weave store to be a versioned store, using WeaveFiles which maintain integrity without needing explicit 'put' operations.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
from bzrlib.transport import get_transport
45
45
from bzrlib.transport.local import LocalTransport
46
46
from bzrlib.weave import Weave
47
 
from bzrlib.weavefile import read_weave, write_weave
48
47
from bzrlib.xml4 import serializer_v4
49
48
from bzrlib.xml5 import serializer_v5
50
49
 
1274
1273
                self.bzrdir.transport.mkdir('weaves')
1275
1274
        except errors.NoSuchFile:
1276
1275
            self.bzrdir.transport.mkdir('weaves')
 
1276
        # deliberately not a WeaveFile as we want to build it up slowly.
1277
1277
        self.inv_weave = Weave('inventory')
1278
1278
        # holds in-memory weaves for all files
1279
1279
        self.text_weaves = {}
1328
1328
        weaves = WeaveStore(weave_transport, prefixed=False)
1329
1329
        transaction = PassThroughTransaction()
1330
1330
 
1331
 
        controlweaves.put_weave('inventory', self.inv_weave, transaction)
1332
 
        i = 0
1333
1331
        try:
 
1332
            i = 0
1334
1333
            for file_id, file_weave in self.text_weaves.items():
1335
1334
                self.pb.update('writing weave', i, len(self.text_weaves))
1336
 
                weaves.put_weave(file_id, file_weave, transaction)
 
1335
                weaves._put_weave(file_id, file_weave, transaction)
1337
1336
                i += 1
 
1337
            self.pb.update('inventory', 0, 1)
 
1338
            controlweaves._put_weave('inventory', self.inv_weave, transaction)
 
1339
            self.pb.update('inventory', 1, 1)
1338
1340
        finally:
1339
1341
            self.pb.clear()
1340
1342