~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Robert Collins
  • Date: 2005-10-03 01:15:02 UTC
  • mfrom: (1092.2.28)
  • Revision ID: robertc@robertcollins.net-20051003011502-f579a509a136b774
mergeĀ fromĀ baz2bzr

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
    def get_file_lines(self, file_id):
135
135
        ie = self._inventory[file_id]
136
136
        weave = self.get_weave(file_id)
137
 
        return weave.get(ie.text_version)
 
137
        return weave.get(ie.revision)
138
138
        
139
139
 
140
140
    def get_file_text(self, file_id):
160
160
        for path, entry in self.inventory.iter_entries():
161
161
            yield path, 'V', entry.kind, entry.file_id
162
162
 
 
163
    def get_symlink_target(self, file_id):
 
164
        ie = self._inventory[file_id]
 
165
        return ie.symlink_target;
163
166
 
164
167
class EmptyTree(Tree):
165
168
    def __init__(self):
166
169
        self._inventory = Inventory()
167
170
 
 
171
    def get_symlink_target(self, file_id):
 
172
        return None
 
173
 
168
174
    def has_filename(self, filename):
169
175
        return False
170
176
 
274
280
            os.mkdir(fullpath)
275
281
        elif kind == 'file':
276
282
            pumpfile(tree.get_file(ie.file_id), file(fullpath, 'wb'))
 
283
        elif kind == 'symlink':
 
284
            try:
 
285
                os.symlink(ie.symlink_target, fullpath)
 
286
            except OSError,e:
 
287
                raise BzrError("Failed to create symlink %r -> %r, error: %s" % (fullpath, ie.symlink_target, e))
277
288
        else:
278
289
            raise BzrError("don't know how to export {%s} of kind %r" % (ie.file_id, kind))
279
290
        mutter("  export {%s} kind %s to %s" % (ie.file_id, kind, fullpath))