/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/lockdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-05-05 08:19:49 UTC
  • mfrom: (1694.2.7 bzr.mbp.lockdir)
  • Revision ID: pqm@pqm.ubuntu.com-20060505081949-c953c4dd61f52b81
(mbp,olaf) lockdir and diff improvements

Show diffs side-by-side

added added

removed removed

Lines of Context:
123
123
# lock at the same time they should *both* get it.  But then that's unlikely
124
124
# to be a good idea.
125
125
 
126
 
# TODO: Transport could offer a simpler put() method that avoids the
127
 
# rename-into-place for cases like creating the lock template, where there is
128
 
# no chance that the file already exists.
129
 
 
130
126
# TODO: Perhaps store some kind of note like the bzr command line in the lock
131
127
# info?
132
128
 
199
195
            sio = StringIO()
200
196
            self._prepare_info(sio)
201
197
            sio.seek(0)
202
 
            self.transport.put(tmpname + self.__INFO_NAME, sio)
 
198
            # append will create a new file; we use append rather than put
 
199
            # because we don't want to write to a temporary file and rename
 
200
            # into place, because that's going to happen to the whole
 
201
            # directory
 
202
            self.transport.append(tmpname + self.__INFO_NAME, sio)
203
203
            self.transport.rename(tmpname, self._held_dir)
204
204
            self._lock_held = True
205
205
            self.confirm()