/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: Daniel Watkins
  • Date: 2007-11-06 09:33:05 UTC
  • mfrom: (2967 +trunk)
  • mto: This revision was merged to the branch mainline in revision 2993.
  • Revision ID: d.m.watkins@warwick.ac.uk-20071106093305-zfef3c0jbcvunnuz
Merged bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
        raise NotImplementedError(self.has_filename)
126
126
 
127
127
    def has_id(self, file_id):
128
 
        file_id = osutils.safe_file_id(file_id)
129
128
        return self.inventory.has_id(file_id)
130
129
 
131
130
    __contains__ = has_id
132
131
 
133
132
    def has_or_had_id(self, file_id):
134
 
        file_id = osutils.safe_file_id(file_id)
135
133
        if file_id == self.inventory.root.file_id:
136
134
            return True
137
135
        return self.inventory.has_id(file_id)
152
150
 
153
151
        :raises NoSuchId:
154
152
        """
155
 
        file_id = osutils.safe_file_id(file_id)
156
153
        return self.inventory.id2path(file_id)
157
154
 
158
155
    def is_control_filename(self, filename):
188
185
        raise NotImplementedError("Tree subclass %s must implement kind"
189
186
            % self.__class__.__name__)
190
187
 
 
188
    def path_content_summary(self, path):
 
189
        """Get a summary of the information about path.
 
190
        
 
191
        :param path: A relative path within the tree.
 
192
        :return: A tuple containing kind, size, exec, sha1-or-link.
 
193
            Kind is always present (see tree.kind()).
 
194
            size is present if kind is file, None otherwise.
 
195
            exec is None unless kind is file and the platform supports the 'x'
 
196
                bit.
 
197
            sha1-or-link is the link target if kind is symlink, or the sha1 if
 
198
                it can be obtained without reading the file.
 
199
        """
 
200
        raise NotImplementedError(self.path_content_summary)
 
201
 
191
202
    def get_reference_revision(self, file_id, path=None):
192
203
        raise NotImplementedError("Tree subclass %s must implement "
193
204
                                  "get_reference_revision"
341
352
 
342
353
    def print_file(self, file_id):
343
354
        """Print file with id `file_id` to stdout."""
344
 
        file_id = osutils.safe_file_id(file_id)
345
355
        import sys
346
356
        sys.stdout.write(self.get_file_text(file_id))
347
357
 
436
446
        return False
437
447
 
438
448
    def kind(self, file_id):
439
 
        file_id = osutils.safe_file_id(file_id)
440
449
        assert self._inventory[file_id].kind == "directory"
441
450
        return "directory"
442
451
 
444
453
        return iter([])
445
454
    
446
455
    def __contains__(self, file_id):
447
 
        file_id = osutils.safe_file_id(file_id)
448
456
        return (file_id in self._inventory)
449
457
 
450
458
    def get_file_sha1(self, file_id, path=None, stat_value=None):