~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/repository_implementations/helpers.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:
58
58
            inv_sha1 = repo.add_inventory('revision-id', inv, [])
59
59
            if repo.supports_rich_root():
60
60
                root_id = inv.root.file_id
61
 
                vf = repo.weave_store.get_weave_or_empty(root_id,
62
 
                    repo.get_transaction())
63
 
                vf.add_lines('revision-id', [], [])
 
61
                repo.texts.add_lines((root_id, 'revision-id'), [], [])
64
62
            revision = _mod_revision.Revision('revision-id',
65
63
                committer='jrandom@example.com', timestamp=0,
66
64
                inventory_sha1=inv_sha1, timezone=0, message='message',
67
65
                parent_ids=[])
68
66
            # Manually add the revision text using the RevisionStore API, with
69
67
            # bad parents.
70
 
            rev_tmp = StringIO()
71
 
            repo._revision_store._serializer.write_revision(revision, rev_tmp)
72
 
            rev_tmp.seek(0)
73
 
            repo._revision_store.get_revision_file(repo.get_transaction()
74
 
                ).add_lines_with_ghosts(revision.revision_id,
75
 
                ['incorrect-parent'],
76
 
                osutils.split_lines(rev_tmp.read()))
 
68
            rev_text = repo._serializer.write_revision_to_string(revision)
 
69
            repo.revisions.add_lines((revision.revision_id,),
 
70
                [('incorrect-parent',)],
 
71
                osutils.split_lines(rev_text))
77
72
        except:
78
73
            repo.abort_write_group()
79
74
            repo.unlock()