~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: John Arbash Meinel
  • Date: 2007-02-18 00:22:24 UTC
  • mto: This revision was merged to the branch mainline in revision 2298.
  • Revision ID: john@arbash-meinel.com-20070218002224-nfsw9ubivr178ahn
Switch all apis over to utf8 file ids. All tests pass

Show diffs side-by-side

added added

removed removed

Lines of Context:
114
114
        raise NotImplementedError()
115
115
 
116
116
    def has_id(self, file_id):
 
117
        file_id = osutils.safe_file_id(file_id)
117
118
        return self.inventory.has_id(file_id)
118
119
 
119
120
    __contains__ = has_id
120
121
 
121
122
    def has_or_had_id(self, file_id):
 
123
        file_id = osutils.safe_file_id(file_id)
122
124
        if file_id == self.inventory.root.file_id:
123
125
            return True
124
126
        return self.inventory.has_id(file_id)
127
129
        return iter(self.inventory)
128
130
 
129
131
    def id2path(self, file_id):
 
132
        file_id = osutils.safe_file_id(file_id)
130
133
        return self.inventory.id2path(file_id)
131
134
 
132
135
    def is_control_filename(self, filename):
217
220
 
218
221
    def print_file(self, file_id):
219
222
        """Print file with id `file_id` to stdout."""
 
223
        file_id = osutils.safe_file_id(file_id)
220
224
        import sys
221
225
        sys.stdout.write(self.get_file_text(file_id))
222
226
 
263
267
        return False
264
268
 
265
269
    def kind(self, file_id):
 
270
        file_id = osutils.safe_file_id(file_id)
266
271
        assert self._inventory[file_id].kind == "directory"
267
272
        return "directory"
268
273
 
270
275
        return iter([])
271
276
    
272
277
    def __contains__(self, file_id):
 
278
        file_id = osutils.safe_file_id(file_id)
273
279
        return (file_id in self._inventory)
274
280
 
275
281
    def get_file_sha1(self, file_id, path=None, stat_value=None):