/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: Aaron Bentley
  • Date: 2006-09-09 18:52:57 UTC
  • mfrom: (1996 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1997.
  • Revision ID: aaron.bentley@utoronto.ca-20060909185257-ce0ee03ee5125ff1
Merge bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
189
189
            raise UnlockableTransport(self.transport)
190
190
        try:
191
191
            tmpname = '%s/pending.%s.tmp' % (self.path, rand_chars(20))
192
 
            self.transport.mkdir(tmpname)
 
192
            try:
 
193
                self.transport.mkdir(tmpname)
 
194
            except NoSuchFile:
 
195
                # This may raise a FileExists exception
 
196
                # which is okay, it will be caught later and determined
 
197
                # to be a LockContention.
 
198
                self.create(mode=self._dir_modebits)
 
199
                
 
200
                # After creating the lock directory, try again
 
201
                self.transport.mkdir(tmpname)
 
202
 
193
203
            sio = StringIO()
194
204
            self._prepare_info(sio)
195
205
            sio.seek(0)
197
207
            # because we don't want to write to a temporary file and rename
198
208
            # into place, because that's going to happen to the whole
199
209
            # directory
200
 
            self.transport.append(tmpname + self.__INFO_NAME, sio)
 
210
            self.transport.append_file(tmpname + self.__INFO_NAME, sio)
 
211
 
201
212
            self.transport.rename(tmpname, self._held_dir)
202
213
            self._lock_held = True
203
214
            self.confirm()