~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml.py

  • Committer: Aaron Bentley
  • Date: 2005-10-04 04:32:32 UTC
  • mfrom: (1185.12.6)
  • mto: (1185.12.13)
  • mto: This revision was merged to the branch mainline in revision 1419.
  • Revision ID: aaron.bentley@utoronto.ca-20051004043231-40302a149769263b
merged my own changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
                                              Element, XMLTreeBuilder,
36
36
                                              fromstring, tostring)
37
37
 
 
38
from bzrlib.inventory import ROOT_ID, Inventory, InventoryEntry
38
39
from bzrlib.errors import BzrError
39
40
 
40
41
 
46
47
        self._write_element(elt, f)
47
48
 
48
49
    def write_inventory_to_string(self, inv):
49
 
        return tostring(self._pack_inventory(inv)) + '\n'
 
50
        return tostring(self._pack_inventory(inv))
50
51
 
51
52
    def read_inventory_from_string(self, xml_string):
52
53
        return self._unpack_inventory(fromstring(xml_string))
58
59
        self._write_element(self._pack_revision(rev), f)
59
60
 
60
61
    def write_revision_to_string(self, rev):
61
 
        return tostring(self._pack_revision(rev)) + '\n'
 
62
        return tostring(self._pack_revision(rev), f)
62
63
 
63
64
    def read_revision(self, f):
64
65
        return self._unpack_revision(self._read_element(f))