~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/xml5.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:
130
130
            ie = inventory.InventoryDirectory(elt.get('file_id'),
131
131
                                              elt.get('name'),
132
132
                                              parent_id)
 
133
        elif kind == 'file':
 
134
            ie = inventory.InventoryFile(elt.get('file_id'),
 
135
                                         elt.get('name'),
 
136
                                         parent_id)
 
137
            ie.text_sha1 = elt.get('text_sha1')
 
138
            if elt.get('executable') == 'yes':
 
139
                ie.executable = True
 
140
            v = elt.get('text_size')
 
141
            ie.text_size = v and int(v)
133
142
        else:
134
143
            ie = InventoryEntry(elt.get('file_id'),
135
144
                                elt.get('name'),
136
145
                                kind,
137
146
                                parent_id)
138
 
            ie.text_sha1 = elt.get('text_sha1')
139
147
            ie.symlink_target = elt.get('symlink_target')
140
 
            if elt.get('executable') == 'yes':
141
 
                ie.executable = True
142
 
            v = elt.get('text_size')
143
 
            ie.text_size = v and int(v)
144
148
        ie.revision = elt.get('revision')
145
149
 
146
150
        return ie