264
264
self.assertEqual([None, 'the_ghost', 'ghost'], repo.get_ancestry('ghost'))
265
265
self.assertEqual([None, 'the_ghost'], repo.get_ancestry('the_ghost'))
267
def test_text_from_ghost_revision(self):
268
repo = self.make_repository('text-from-ghost')
269
inv = Inventory(revision_id='final-revid')
270
inv.root.revision = 'root-revid'
271
ie = inv.add_path('bla', 'file', 'myfileid')
272
ie.revision = 'ghostrevid'
274
ie.text_sha1 = "bee68c8acd989f5f1765b4660695275948bf5c00"
275
rev = bzrlib.revision.Revision(timestamp=0,
277
committer="Foo Bar <foo@example.com>",
279
revision_id='final-revid')
282
repo.start_write_group()
284
repo.add_revision('final-revid', rev, inv)
286
repo.texts.add_lines(('myfileid', 'ghostrevid'),
287
(('myfileid', 'ghost-text-parent'),),
288
["line1\n", "line2\n"])
289
except errors.RevisionNotPresent:
290
raise TestSkipped("text ghost parents not supported")
291
if repo.supports_rich_root():
292
root_id = inv.root.file_id
293
repo.texts.add_lines((inv.root.file_id, inv.root.revision),
296
repo.commit_write_group()
299
repo.reconcile(thorough=True)
268
302
class TestReconcileWithIncorrectRevisionCache(TestReconcile):
269
303
"""Ancestry data gets cached in knits and weaves should be reconcilable.