~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_repository/test_reconcile.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-04 21:25:46 UTC
  • mfrom: (4409 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4410.
  • Revision ID: john@arbash-meinel.com-20090604212546-dpmrzvg49q40tvnj
Merge bzr.dev 4409, resolve NEWS

Show diffs side-by-side

added added

removed removed

Lines of Context:
264
264
        self.assertEqual([None, 'the_ghost', 'ghost'], repo.get_ancestry('ghost'))
265
265
        self.assertEqual([None, 'the_ghost'], repo.get_ancestry('the_ghost'))
266
266
 
 
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'
 
273
        ie.text_size = 42
 
274
        ie.text_sha1 = "bee68c8acd989f5f1765b4660695275948bf5c00"
 
275
        rev = bzrlib.revision.Revision(timestamp=0,
 
276
                                       timezone=None,
 
277
                                       committer="Foo Bar <foo@example.com>",
 
278
                                       message="Message",
 
279
                                       revision_id='final-revid')
 
280
        repo.lock_write()
 
281
        try:
 
282
            repo.start_write_group()
 
283
            try:
 
284
                repo.add_revision('final-revid', rev, inv)
 
285
                try:
 
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),
 
294
                        [], [])
 
295
            finally:
 
296
                repo.commit_write_group()
 
297
        finally:
 
298
            repo.unlock()
 
299
        repo.reconcile(thorough=True)
 
300
 
267
301
 
268
302
class TestReconcileWithIncorrectRevisionCache(TestReconcile):
269
303
    """Ancestry data gets cached in knits and weaves should be reconcilable.