~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commit.py

  • Committer: Martin Pool
  • Date: 2005-06-28 05:33:40 UTC
  • Revision ID: mbp@sourcefrog.net-20050628053340-ea73b03fbcde9c46
- Remove XMLMixin class in favour of simple pack_xml, unpack_xml functions
  called as needed.  

- Avoid importing xml and ElementTree library unless needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
    from bzrlib.errors import BzrError
61
61
    from bzrlib.revision import Revision, RevisionReference
62
62
    from bzrlib.trace import mutter, note
 
63
    from bzrlib.xml import pack_xml
63
64
 
64
65
    branch.lock_write()
65
66
 
108
109
        inv_id = rev_id
109
110
 
110
111
        inv_tmp = tempfile.TemporaryFile()
111
 
        new_inv.write_xml(inv_tmp)
 
112
        pack_xml(new_inv, inv_tmp)
112
113
        inv_tmp.seek(0)
113
114
        branch.inventory_store.add(inv_tmp, inv_id)
114
115
        mutter('new inventory_id is {%s}' % inv_id)
144
145
            rev.parents = [RevisionReference(precursor_id, precursor_sha1)]
145
146
 
146
147
        rev_tmp = tempfile.TemporaryFile()
147
 
        rev.write_xml(rev_tmp)
 
148
        pack_xml(rev, rev_tmp)
148
149
        rev_tmp.seek(0)
149
150
        branch.revision_store.add(rev_tmp, rev_id)
150
151
        mutter("new revision_id is {%s}" % rev_id)