~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml4.py

  • Committer: Robert Collins
  • Date: 2005-10-03 14:47:12 UTC
  • mto: (1393.1.30)
  • mto: This revision was merged to the branch mainline in revision 1400.
  • Revision ID: robertc@robertcollins.net-20051003144712-44b3339bd5cfcf69
factor out file related logic from InventoryEntry to InventoryFile

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
            ie = inventory.InventoryDirectory(elt.get('file_id'),
101
101
                                              elt.get('name'),
102
102
                                              parent_id)
 
103
        elif kind == 'file':
 
104
            ie = inventory.InventoryFile(elt.get('file_id'),
 
105
                                         elt.get('name'),
 
106
                                         parent_id)
 
107
            ie.text_id = elt.get('text_id')
 
108
            ie.text_sha1 = elt.get('text_sha1')
 
109
            v = elt.get('text_size')
 
110
            ie.text_size = v and int(v)
103
111
        else:
104
112
            ie = InventoryEntry(elt.get('file_id'),
105
113
                                elt.get('name'),
106
114
                                elt.get('kind'),
107
115
                                parent_id)
108
 
            ie.text_id = elt.get('text_id')
109
 
            ie.text_sha1 = elt.get('text_sha1')
110
116
            ie.symlink_target = elt.get('symlink_target')
111
117
 
112
118
        ## mutter("read inventoryentry: %r" % (elt.attrib))
113
119
 
114
 
        v = elt.get('text_size')
115
 
        ie.text_size = v and int(v)
116
 
 
117
120
        return ie
118
121
 
119
122