~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockable_files.py

  • Committer: wang
  • Date: 2006-10-29 13:41:32 UTC
  • mto: (2104.4.1 wang_65714)
  • mto: This revision was merged to the branch mainline in revision 2109.
  • Revision ID: wang@ubuntu-20061029134132-3d7f4216f20c4aef
Replace python's difflib by patiencediff because the worst case 
performance is cubic for difflib and people commiting large data 
files are often hurt by this. The worst case performance of patience is 
quadratic. Fix bug 65714.

Show diffs side-by-side

added added

removed removed

Lines of Context:
193
193
                     directory
194
194
        :param f: A file-like or string object whose contents should be copied.
195
195
        """
196
 
        self._transport.put(self._escape(path), file, mode=self._file_mode)
 
196
        self._transport.put_file(self._escape(path), file, mode=self._file_mode)
197
197
 
198
198
    @needs_write_lock
199
199
    def put_utf8(self, path, a_string):
339
339
    def create(self, mode=None):
340
340
        """Create lock mechanism"""
341
341
        # for old-style locks, create the file now
342
 
        self._transport.put(self._escaped_name, StringIO(), 
 
342
        self._transport.put_bytes(self._escaped_name, '',
343
343
                            mode=self._file_modebits)