~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Aaron Bentley
  • Date: 2006-12-22 03:28:50 UTC
  • mto: (2255.6.1 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: aaron.bentley@utoronto.ca-20061222032850-nfiemdjr81urpbm3
Test workingtree4 format, prevent use with old repos

Show diffs side-by-side

added added

removed removed

Lines of Context:
309
309
        self._control_files.break_lock()
310
310
        self.branch.break_lock()
311
311
 
 
312
    def requires_rich_root(self):
 
313
        return self._format.requires_rich_root
 
314
 
312
315
    def _set_inventory(self, inv, dirty):
313
316
        """Set the internal cached inventory.
314
317
 
1518
1521
    def _create_basis_xml_from_inventory(self, revision_id, inventory):
1519
1522
        """Create the text that will be saved in basis-inventory"""
1520
1523
        inventory.revision_id = revision_id
1521
 
        return xml6.serializer_v6.write_inventory_to_string(inventory)
 
1524
        return xml7.serializer_v7.write_inventory_to_string(inventory)
1522
1525
 
1523
1526
    def _cache_basis_inventory(self, new_revision):
1524
1527
        """Cache new_revision as the basis inventory."""
1539
1542
            xml = self.branch.repository.get_inventory_xml(new_revision)
1540
1543
            firstline = xml.split('\n', 1)[0]
1541
1544
            if (not 'revision_id="' in firstline or 
1542
 
                'format="6"' not in firstline):
 
1545
                'format="7"' not in firstline):
1543
1546
                inv = self.branch.repository.deserialise_inventory(
1544
1547
                    new_revision, xml)
1545
1548
                xml = self._create_basis_xml_from_inventory(new_revision, inv)
2037
2040
    _formats = {}
2038
2041
    """The known formats."""
2039
2042
 
 
2043
    requires_rich_root = False
 
2044
 
2040
2045
    @classmethod
2041
2046
    def find_format(klass, a_bzrdir):
2042
2047
        """Return the format for the working tree object in a_bzrdir."""
2278
2283
 
2279
2284
    _tree_class = WorkingTree4
2280
2285
 
 
2286
    requires_rich_root = True
 
2287
 
2281
2288
    def get_format_string(self):
2282
2289
        """See WorkingTreeFormat.get_format_string()."""
2283
2290
        return "Bazaar-NG Working Tree format 4"