~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml8.py

  • Committer: Joe Julian
  • Date: 2010-01-10 02:25:31 UTC
  • mto: (4634.119.7 2.0)
  • mto: This revision was merged to the branch mainline in revision 4959.
  • Revision ID: joe@julianfamily.org-20100110022531-wqk61rsagz8xsiga
Added MANIFEST.in to allow bdist_rpm to have all the required include files and tools. bdist_rpm will still fail to build correctly on some distributions due to a disttools bug http://bugs.python.org/issue644744

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
    revision as _mod_revision,
25
25
    trace,
26
26
    )
27
 
from bzrlib.xml_serializer import SubElement, Element, Serializer
 
27
from bzrlib.xml_serializer import (
 
28
    Element,
 
29
    SubElement,
 
30
    XMLSerializer,
 
31
    escape_invalid_chars,
 
32
    )
28
33
from bzrlib.inventory import ROOT_ID, Inventory, InventoryEntry
29
34
from bzrlib.revision import Revision
30
35
from bzrlib.errors import BzrError
139
144
    _to_escaped_map.clear()
140
145
 
141
146
 
142
 
class Serializer_v8(Serializer):
 
147
class Serializer_v8(XMLSerializer):
143
148
    """This serialiser adds rich roots.
144
149
 
145
150
    Its revision format number matches its inventory number.
160
165
        """Extension point for subclasses to check during serialisation.
161
166
 
162
167
        :param inv: An inventory about to be serialised, to be checked.
163
 
        :raises: AssertionError if an error has occured.
 
168
        :raises: AssertionError if an error has occurred.
164
169
        """
165
170
        if inv.revision_id is None:
166
 
            raise AssertionError()
 
171
            raise AssertionError("inv.revision_id is None")
167
172
        if inv.root.revision is None:
168
 
            raise AssertionError()
 
173
            raise AssertionError("inv.root.revision is None")
169
174
 
170
175
    def _check_cache_size(self, inv_size, entry_cache):
171
176
        """Check that the entry_cache is large enough.
341
346
            root.set('timezone', str(rev.timezone))
342
347
        root.text = '\n'
343
348
        msg = SubElement(root, 'message')
344
 
        msg.text = rev.message
 
349
        msg.text = escape_invalid_chars(rev.message)[0]
345
350
        msg.tail = '\n'
346
351
        if rev.parent_ids:
347
352
            pelts = SubElement(root, 'parents')
422
427
        if entry_cache is not None and revision is not None:
423
428
            key = (file_id, revision)
424
429
            try:
425
 
                # We copy it, because some operatations may mutate it
 
430
                # We copy it, because some operations may mutate it
426
431
                cached_ie = entry_cache[key]
427
432
            except KeyError:
428
433
                pass