~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Aaron Bentley
  • Date: 2007-08-29 05:22:21 UTC
  • mto: This revision was merged to the branch mainline in revision 2765.
  • Revision ID: aaron.bentley@utoronto.ca-20070829052221-27rynnk5yws2619u
Detect irregularities with the pending-deletion directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
110
110
                    raise ExistingLimbo(self._limbodir)
111
111
            self._deletiondir = urlutils.local_path_from_url(
112
112
                control_files.controlfilename('pending-deletion'))
113
 
            os.mkdir(self._deletiondir)
 
113
            try:
 
114
                os.mkdir(self._deletiondir)
 
115
            except OSError, e:
 
116
                if e.errno == errno.EEXIST:
 
117
                    raise errors.ExistingPendingDeletion(self._deletiondir)
 
118
 
114
119
        except: 
115
120
            self._tree.unlock()
116
121
            raise
173
178
            except OSError:
174
179
                # We don't especially care *why* the dir is immortal.
175
180
                raise ImmortalLimbo(self._limbodir)
176
 
            os.rmdir(self._deletiondir)
 
181
            try:
 
182
                os.rmdir(self._deletiondir)
 
183
            except OSError:
 
184
                raise errors.ImmortalPendingDeletion(self._deletiondir)
177
185
        finally:
178
186
            self._tree.unlock()
179
187
            self._tree = None