~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml4.py

  • Committer: Robert J. Tanner
  • Date: 2009-06-10 03:56:49 UTC
  • mfrom: (4423 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4425.
  • Revision ID: tanner@real-time.com-20090610035649-7rfx4cls4550zc3c
Merge 1.15.1 back to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
    ElementTree,
20
20
    SubElement,
21
21
    XMLSerializer,
22
 
    escape_invalid_chars,
23
22
    )
24
23
from bzrlib.inventory import ROOT_ID, Inventory, InventoryEntry
25
24
import bzrlib.inventory as inventory
63
62
        return e
64
63
 
65
64
 
66
 
    def _unpack_inventory(self, elt, revision_id=None, entry_cache=None,
67
 
                          return_from_cache=False):
 
65
    def _unpack_inventory(self, elt, revision_id=None, entry_cache=None):
68
66
        """Construct from XML Element
69
67
 
70
68
        :param revision_id: Ignored parameter used by xml5.
72
70
        root_id = elt.get('file_id') or ROOT_ID
73
71
        inv = Inventory(root_id)
74
72
        for e in elt:
75
 
            ie = self._unpack_entry(e, entry_cache=entry_cache,
76
 
                                    return_from_cache=return_from_cache)
 
73
            ie = self._unpack_entry(e, entry_cache=entry_cache)
77
74
            if ie.parent_id == ROOT_ID:
78
75
                ie.parent_id = root_id
79
76
            inv.add(ie)
80
77
        return inv
81
78
 
82
79
 
83
 
    def _unpack_entry(self, elt, entry_cache=None, return_from_cache=False):
 
80
    def _unpack_entry(self, elt, entry_cache=None):
84
81
        ## original format inventories don't have a parent_id for
85
82
        ## nodes in the root directory, but it's cleaner to use one
86
83
        ## internally.
128
125
        root.text = '\n'
129
126
 
130
127
        msg = SubElement(root, 'message')
131
 
        msg.text = escape_invalid_chars(rev.message)[0]
 
128
        msg.text = rev.message
132
129
        msg.tail = '\n'
133
130
 
134
131
        if rev.parents: