~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml4.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-16 22:35:21 UTC
  • mto: This revision was merged to the branch mainline in revision 1942.
  • Revision ID: john@arbash-meinel.com-20060816223521-73357694d4b7df0b
One field was incorrect, need text_sha1 not text_size

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
2
 
#
3
1
# This program is free software; you can redistribute it and/or modify
4
2
# it under the terms of the GNU General Public License as published by
5
3
# the Free Software Foundation; either version 2 of the License, or
14
12
# along with this program; if not, write to the Free Software
15
13
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
14
 
 
15
 
17
16
from bzrlib.xml_serializer import ElementTree, SubElement, Element, Serializer
18
17
from bzrlib.inventory import ROOT_ID, Inventory, InventoryEntry
19
18
import bzrlib.inventory as inventory
21
20
from bzrlib.errors import BzrError
22
21
 
23
22
 
 
23
 
 
24
 
 
25
 
 
26
 
24
27
class _Serializer_v4(Serializer):
25
28
    """Version 0.0.4 serializer
26
29
 
48
51
        e.set('file_id', ie.file_id)
49
52
        e.set('kind', ie.kind)
50
53
 
51
 
        if ie.text_size is not None:
 
54
        if ie.text_size != None:
52
55
            e.set('text_size', '%d' % ie.text_size)
53
56
 
54
57
        for f in ['text_id', 'text_sha1', 'symlink_target']:
55
58
            v = getattr(ie, f)
56
 
            if v is not None:
 
59
            if v != None:
57
60
                e.set(f, v)
58
61
 
59
62
        # to be conservative, we don't externalize the root pointers
89
92
        ## nodes in the root directory, but it's cleaner to use one
90
93
        ## internally.
91
94
        parent_id = elt.get('parent_id')
92
 
        if parent_id is None:
 
95
        if parent_id == None:
93
96
            parent_id = ROOT_ID
94
97
 
95
98
        kind = elt.get('kind')