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

  • Committer: Robert Collins
  • Date: 2010-05-06 11:08:10 UTC
  • mto: This revision was merged to the branch mainline in revision 5223.
  • Revision ID: robertc@robertcollins.net-20100506110810-h3j07fh5gmw54s25
Cleaner matcher matching revised unlocking protocol.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
    errors,
20
20
    inventory,
21
21
    xml6,
22
 
    )
23
 
from bzrlib.xml_serializer import (
24
 
    encode_and_escape,
25
 
    get_utf8_or_ascii,
26
 
    unpack_inventory_entry,
27
 
    )
28
 
 
 
22
    xml8,
 
23
    )
29
24
 
30
25
class Serializer_v5(xml6.Serializer_v6):
31
26
    """Version 5 serializer
40
35
        """Construct from XML Element
41
36
        """
42
37
        root_id = elt.get('file_id') or inventory.ROOT_ID
43
 
        root_id = get_utf8_or_ascii(root_id)
 
38
        root_id = xml8._get_utf8_or_ascii(root_id)
44
39
 
45
40
        format = elt.get('format')
46
41
        if format is not None:
57
52
        #   avoiding attributes     2.46s
58
53
        #   adding assertions       2.50s
59
54
        #   last_parent cache       2.52s (worse, removed)
 
55
        unpack_entry = self._unpack_entry
60
56
        byid = inv._byid
61
57
        for e in elt:
62
 
            ie = unpack_inventory_entry(e, entry_cache=entry_cache,
 
58
            ie = unpack_entry(e, entry_cache=entry_cache,
63
59
                              return_from_cache=return_from_cache)
64
60
            parent_id = ie.parent_id
65
61
            if parent_id is None:
96
92
        """Append the inventory root to output."""
97
93
        if inv.root.file_id not in (None, inventory.ROOT_ID):
98
94
            fileid1 = ' file_id="'
99
 
            fileid2 = encode_and_escape(inv.root.file_id)
 
95
            fileid2 = xml8._encode_and_escape(inv.root.file_id)
100
96
        else:
101
97
            fileid1 = ""
102
98
            fileid2 = ""
103
99
        if inv.revision_id is not None:
104
100
            revid1 = ' revision_id="'
105
 
            revid2 = encode_and_escape(inv.revision_id)
 
101
            revid2 = xml8._encode_and_escape(inv.revision_id)
106
102
        else:
107
103
            revid1 = ""
108
104
            revid2 = ""