~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

First cut at pluralised VersionedFiles. Some rather massive API incompatabilities, primarily because of the difficulty of coherence among competing stores.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
    symbol_versioning,
51
51
    ui,
52
52
    urlutils,
 
53
    versionedfile,
53
54
    win32utils,
54
55
    workingtree,
55
56
    workingtree_4,
62
63
    )
63
64
from bzrlib.smart.client import _SmartClient
64
65
from bzrlib.smart import protocol
65
 
from bzrlib.store.revision.text import TextRevisionStore
66
 
from bzrlib.store.text import TextStore
 
66
from bzrlib.repofmt.weaverepo import TextRevisionStore, RevisionTextStore
67
67
from bzrlib.store.versioned import WeaveStore
68
68
from bzrlib.transactions import WriteTransaction
69
69
from bzrlib.transport import (
2012
2012
        self.bzrdir.transport.mkdir('revision-store')
2013
2013
        revision_transport = self.bzrdir.transport.clone('revision-store')
2014
2014
        # TODO permissions
2015
 
        _revision_store = TextRevisionStore(TextStore(revision_transport,
2016
 
                                                      prefixed=False,
2017
 
                                                      compressed=True))
 
2015
        from bzrlib.xml5 import serializer_v5
 
2016
        revision_store = RevisionTextStore(revision_transport,
 
2017
            serializer_v5, False, versionedfile.PrefixMapper(),
 
2018
            lambda:True, lambda:True)
2018
2019
        try:
2019
 
            transaction = WriteTransaction()
2020
2020
            for i, rev_id in enumerate(self.converted_revs):
2021
2021
                self.pb.update('write revision', i, len(self.converted_revs))
2022
 
                _revision_store.add_revision(self.revisions[rev_id], transaction)
 
2022
                text = serializer_v5.write_revision_to_string(
 
2023
                    self.revisions[rev_id])
 
2024
                key = (rev_id,)
 
2025
                revision_store.add_lines(key, None, osutils.split_lines(text))
2023
2026
        finally:
2024
2027
            self.pb.clear()
2025
2028
            
2038
2041
                         rev_id)
2039
2042
            self.absent_revisions.add(rev_id)
2040
2043
        else:
2041
 
            rev = self.branch.repository._revision_store.get_revision(rev_id,
2042
 
                self.branch.repository.get_transaction())
 
2044
            rev = self.branch.repository.get_revision(rev_id)
2043
2045
            for parent_id in rev.parent_ids:
2044
2046
                self.known_revisions.add(parent_id)
2045
2047
                self.to_read.append(parent_id)
2135
2137
                ie.revision = previous_ie.revision
2136
2138
                return
2137
2139
        if ie.has_text():
2138
 
            text = self.branch.repository.weave_store.get(ie.text_id)
 
2140
            text = self.branch.repository._text_store.get(ie.text_id)
2139
2141
            file_lines = text.readlines()
2140
2142
            w.add_lines(rev_id, previous_revisions, file_lines)
2141
2143
            self.text_count += 1