/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

Merge from bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
                            sha_strings,
46
46
                            sha_string,
47
47
                            )
 
48
import bzrlib.revision
48
49
from bzrlib.store.revision.text import TextRevisionStore
49
50
from bzrlib.store.text import TextStore
50
51
from bzrlib.store.versioned import WeaveStore
698
699
        # done on this format anyway. So - acceptable wart.
699
700
        result = self.open_workingtree()
700
701
        if revision_id is not None:
701
 
            result.set_last_revision(revision_id)
 
702
            if revision_id == bzrlib.revision.NULL_REVISION:
 
703
                result.set_parent_ids([])
 
704
            else:
 
705
                result.set_parent_ids([revision_id])
702
706
        return result
703
707
 
704
708
    def get_branch_transport(self, branch_format):
1487
1491
        inv = serializer_v4.read_inventory(self.branch.control_files.get('inventory'))
1488
1492
        new_inv_xml = bzrlib.xml5.serializer_v5.write_inventory_to_string(inv)
1489
1493
        # FIXME inventory is a working tree change.
1490
 
        self.branch.control_files.put('inventory', new_inv_xml)
 
1494
        self.branch.control_files.put('inventory', StringIO(new_inv_xml))
1491
1495
 
1492
1496
    def _write_all_weaves(self):
1493
1497
        controlweaves = WeaveStore(self.bzrdir.transport, prefixed=False)
1578
1582
            entries = inv.iter_entries()
1579
1583
            entries.next()
1580
1584
            for path, ie in entries:
1581
 
                assert hasattr(ie, 'revision'), \
 
1585
                assert getattr(ie, 'revision', None) is not None, \
1582
1586
                    'no revision on {%s} in {%s}' % \
1583
1587
                    (file_id, rev.revision_id)
1584
1588
        new_inv_xml = bzrlib.xml5.serializer_v5.write_inventory_to_string(inv)