~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml6.py

  • Committer: Aaron Bentley
  • Date: 2006-10-29 19:17:04 UTC
  • mto: (2255.6.1 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: aaron.bentley@utoronto.ca-20061029191704-b7221b5e8a873911
Add tests for format 7, enforce number

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
class Serializer_v6(xml5.Serializer_v5):
21
21
 
 
22
    format_num = '6'
 
23
 
22
24
    def _append_inventory_root(self, append, inv):
23
25
        """Append the inventory root to output."""
24
26
        append('<inventory')
25
 
        append(' format="6"')
 
27
        append(' format="%s"' % self.format_num)
26
28
        if inv.revision_id is not None:
27
29
            append(' revision_id="')
28
30
            append(xml5._encode_and_escape(inv.revision_id))
37
39
        if elt.tag != 'inventory':
38
40
            raise errors.UnexpectedInventoryFormat('Root tag is %r' % elt.tag)
39
41
        format = elt.get('format')
40
 
        if format != '6':
 
42
        if format != self.format_num:
41
43
            raise errors.UnexpectedInventoryFormat('Invalid format version %r'
42
44
                                                   % format)
43
45
        revision_id = elt.get('revision_id')