~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/per_workingtree/test_parents.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
392
392
            try:
393
393
                if shape.root.revision is None:
394
394
                    shape.root.revision = revid
 
395
                # Create the text records for this inventory.
 
396
                for path, ie in shape.iter_entries():
 
397
                    if ie.text_size:
 
398
                        lines = ['a' * ie.text_size]
 
399
                    else:
 
400
                        lines = []
 
401
                    tree.branch.repository.texts.add_lines(
 
402
                        (ie.file_id, ie.revision), [], lines)
395
403
                sha1 = tree.branch.repository.add_inventory(revid, shape, [])
396
404
                rev = Revision(timestamp=0,
397
405
                               timezone=None,
400
408
                               inventory_sha1=sha1,
401
409
                               revision_id=revid)
402
410
                tree.branch.repository.add_revision(revid, rev)
 
411
                tree.branch.repository.commit_write_group()
403
412
            except:
404
413
                tree.branch.repository.abort_write_group()
405
414
                raise
406
 
            else:
407
 
                tree.branch.repository.commit_write_group()
408
415
        finally:
409
416
            tree.unlock()
410
417