~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml6.py

  • Committer: Robert Collins
  • Date: 2007-03-07 08:02:58 UTC
  • mfrom: (2255.2.239 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: robertc@robertcollins.net-20070307080258-fi172acyjga89fz5
(robertc) Merge dirstate and subtrees. (Robert Collins, Martin Pool, Aaaron Bentley, John A Meinel, James Westby)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
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')