/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/workingtree.py

Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
410
410
        else:
411
411
            try:
412
412
                xml = self.read_basis_inventory()
413
 
                inv = bzrlib.xml5.serializer_v5.read_inventory_from_string(xml)
414
 
                inv.root.revision = revision_id
415
 
            except NoSuchFile:
416
 
                inv = None
417
 
            if inv is not None and inv.revision_id == revision_id:
418
 
                return bzrlib.tree.RevisionTree(self.branch.repository, inv,
419
 
                                                revision_id)
 
413
                inv = bzrlib.xml6.serializer_v6.read_inventory_from_string(xml)
 
414
                if inv is not None and inv.revision_id == revision_id:
 
415
                    return bzrlib.tree.RevisionTree(self.branch.repository, 
 
416
                                                    inv, revision_id)
 
417
            except (NoSuchFile, errors.BadInventoryFormat):
 
418
                pass
420
419
        # No cached copy available, retrieve from the repository.
421
420
        # FIXME? RBC 20060403 should we cache the inventory locally
422
421
        # at this point ?
1406
1405
        return self._control_files.get_physical_lock_status()
1407
1406
 
1408
1407
    def _basis_inventory_name(self):
1409
 
        return 'basis-inventory'
 
1408
        return 'basis-inventory-cache'
1410
1409
 
1411
1410
    @needs_write_lock
1412
1411
    def set_last_revision(self, new_revision):
1447
1446
            # root node id can legitimately look like 'revision_id' but cannot
1448
1447
            # contain a '"'.
1449
1448
            xml = self.branch.repository.get_inventory_xml(new_revision)
1450
 
            if not 'revision_id="' in xml.split('\n', 1)[0]:
 
1449
            firstline = xml.split('\n', 1)[0]
 
1450
            if (not 'revision_id="' in firstline or 
 
1451
                'format="6"' not in firstline):
1451
1452
                inv = self.branch.repository.deserialise_inventory(
1452
1453
                    new_revision, xml)
1453
1454
                inv.revision_id = new_revision
1454
 
                xml = bzrlib.xml5.serializer_v5.write_inventory_to_string(inv)
 
1455
                xml = bzrlib.xml6.serializer_v6.write_inventory_to_string(inv)
1455
1456
            assert isinstance(xml, str), 'serialised xml must be bytestring.'
1456
1457
            path = self._basis_inventory_name()
1457
1458
            sio = StringIO(xml)