~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/lockdir.py

  • Committer: John Arbash Meinel
  • Date: 2006-09-09 00:10:07 UTC
  • mto: This revision was merged to the branch mainline in revision 1998.
  • Revision ID: john@arbash-meinel.com-20060909001007-bd2a0fed41df131c
Use put_file_non_atomic in lockdir() to save some sftp round trips

Show diffs side-by-side

added added

removed removed

Lines of Context:
203
203
            sio = StringIO()
204
204
            self._prepare_info(sio)
205
205
            sio.seek(0)
206
 
            # append will create a new file; we use append rather than put
207
 
            # because we don't want to write to a temporary file and rename
208
 
            # into place, because that's going to happen to the whole
209
 
            # directory
210
 
            self.transport.append_file(tmpname + self.__INFO_NAME, sio)
 
206
            # We use put_file_non_atomic because we just created a new unique
 
207
            # directory so we don't have to worry about files existing there.
 
208
            # We'll rename the whole directory into place to get atomic
 
209
            # properties
 
210
            self.transport.put_file_non_atomic(tmpname + self.__INFO_NAME, sio)
211
211
 
212
212
            self.transport.rename(tmpname, self._held_dir)
213
213
            self._lock_held = True