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

  • Committer: Daniel Watkins
  • Date: 2007-11-06 09:33:05 UTC
  • mfrom: (2967 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2993.
  • Revision ID: d.m.watkins@warwick.ac.uk-20071106093305-zfef3c0jbcvunnuz
Merged bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
 
20
20
class Serializer_v6(xml5.Serializer_v5):
 
21
    """This serialiser adds rich roots."""
21
22
 
22
23
    format_num = '6'
23
24
    root_id = None
37
38
            xml5._encode_and_escape(inv.root.name),
38
39
            xml5._encode_and_escape(inv.root.revision)))
39
40
 
40
 
    def _unpack_inventory(self, elt):
 
41
    def _check_revisions(self, inv):
 
42
        """Extension point for subclasses to check during serialisation.
 
43
 
 
44
        By default no checking is done.
 
45
 
 
46
        :param inv: An inventory about to be serialised, to be checked.
 
47
        :raises: AssertionError if an error has occured.
 
48
        """
 
49
        assert inv.revision_id is not None
 
50
        assert inv.root.revision is not None
 
51
 
 
52
    def _unpack_inventory(self, elt, revision_id=None):
41
53
        """Construct from XML Element"""
42
54
        if elt.tag != 'inventory':
43
55
            raise errors.UnexpectedInventoryFormat('Root tag is %r' % elt.tag)
52
64
        for e in elt:
53
65
            ie = self._unpack_entry(e)
54
66
            inv.add(ie)
 
67
        assert inv.root.revision is not None
55
68
        return inv
56
69
 
57
70