~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

  • Committer: Robert Collins
  • Date: 2005-10-03 06:00:44 UTC
  • mto: (1393.1.30)
  • mto: This revision was merged to the branch mainline in revision 1400.
  • Revision ID: robertc@robertcollins.net-20051003060044-2e6d98a7452162b8
implement symlink exporting to tarballs

Show diffs side-by-side

added added

removed removed

Lines of Context:
187
187
                    print >>output_to, '=== target is %r' % self.symlink_target
188
188
 
189
189
    def get_tar_item(self, root, dp, now, tree):
 
190
        """Get a tarfile item and a file stream for its content."""
190
191
        item = tarfile.TarInfo(os.path.join(root, dp))
191
192
        # TODO: would be cool to actually set it to the timestamp of the
192
193
        # revision it was last changed
205
206
                item.mode = 0755
206
207
            else:
207
208
                item.mode = 0644
 
209
        elif self.kind == 'symlink':
 
210
            iterm.type = tarfile.SYMTYPE
 
211
            fileobj = None
 
212
            item.size = 0
 
213
            item.mode = 0755
 
214
            item.linkname = self.symlink_target
208
215
        else:
209
216
            raise BzrError("don't know how to export {%s} of kind %r" %
210
217
                    (self.file_id, self.kind))