/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 breezy/workingtree.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-03-24 12:34:34 UTC
  • mfrom: (6874.2.9 iter-files-bytes)
  • Revision ID: breezy.the.bot@gmail.com-20180324123434-zogy2xskr96vv5xm
Change Tree.iter_files_bytes() to take a (path, identifier) list rather than a (file_id, identifier) list.

Merged from https://code.launchpad.net/~jelmer/brz/iter-files-bytes/+merge/340578

Show diffs side-by-side

added added

removed removed

Lines of Context:
373
373
                           _fstat=osutils.fstat):
374
374
        """See Tree.get_file_with_stat."""
375
375
        abspath = self.abspath(path)
376
 
        file_obj = file(abspath, 'rb')
 
376
        try:
 
377
            file_obj = open(abspath, 'rb')
 
378
        except EnvironmentError as e:
 
379
            if e.errno == errno.ENOENT:
 
380
                raise errors.NoSuchFile(path)
 
381
            raise
377
382
        stat_value = _fstat(file_obj.fileno())
378
383
        if filtered and self.supports_content_filtering():
379
384
            filters = self._content_filter_stack(path)
908
913
    def put_file_bytes_non_atomic(self, path, bytes, file_id=None):
909
914
        """See MutableTree.put_file_bytes_non_atomic."""
910
915
        with self.lock_write():
911
 
            stream = file(self.abspath(path), 'wb')
 
916
            stream = open(self.abspath(path), 'wb')
912
917
            try:
913
918
                stream.write(bytes)
914
919
            finally: