~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml5.py

  • Committer: Vincent Ladeuil
  • Date: 2009-09-02 08:26:27 UTC
  • mto: (4669.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4670.
  • Revision ID: v.ladeuil+lp@free.fr-20090902082627-cit8vm6tefu9hwk2
Cleanup emacs-bzr-send-XXXXXX.el leaks in /tmp during selftest.

* tests/test_mail_client.py:
(TestEmacsMail.test_commandline,
TestEmacsMail.test_commandline_is_8bit): Cleanup the generated tmp
file.

* mail_client.py:
(EmacsMail.__init__, EmacsMail._get_compose_commandline): Keep
track of the tmp file to ease cleanup during testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008, 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
30
30
    format_num = '5'
31
31
    root_id = inventory.ROOT_ID
32
32
 
33
 
    def _unpack_inventory(self, elt, revision_id, entry_cache=None,
34
 
                          return_from_cache=False):
 
33
    def _unpack_inventory(self, elt, revision_id, entry_cache=None):
35
34
        """Construct from XML Element
36
35
        """
37
36
        root_id = elt.get('file_id') or inventory.ROOT_ID
55
54
        unpack_entry = self._unpack_entry
56
55
        byid = inv._byid
57
56
        for e in elt:
58
 
            ie = unpack_entry(e, entry_cache=entry_cache,
59
 
                              return_from_cache=return_from_cache)
 
57
            ie = unpack_entry(e, entry_cache=entry_cache)
60
58
            parent_id = ie.parent_id
61
59
            if parent_id is None:
62
60
                ie.parent_id = parent_id = root_id