~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

Disable inheritance for getting at LockableFiles, rather use composition.

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
        self.inv_weave = Weave('inventory')
155
155
        # holds in-memory weaves for all files
156
156
        self.text_weaves = {}
157
 
        os.remove(self.branch.controlfilename('branch-format'))
 
157
        os.remove(self.branch.control_files.controlfilename('branch-format'))
158
158
        self._convert_working_inv()
159
159
        rev_history = self.branch.revision_history()
160
160
        # to_read is a stack holding the revisions we still need to process;
193
193
                           self.branch._branch_format)
194
194
        return True
195
195
 
196
 
 
197
196
    def _set_new_format(self, format):
198
 
        self.branch.put_controlfile('branch-format', format)
199
 
 
 
197
        self.branch.control_files.put_controlfile('branch-format', format)
200
198
 
201
199
    def _cleanup_spare_files(self):
202
200
        for n in 'merged-patches', 'pending-merged-patches':
203
 
            p = self.branch.controlfilename(n)
 
201
            p = self.branch.control_files.controlfilename(n)
204
202
            if not os.path.exists(p):
205
203
                continue
206
204
            ## assert os.path.getsize(p) == 0
208
206
        shutil.rmtree(self.base + '/.bzr/inventory-store')
209
207
        shutil.rmtree(self.base + '/.bzr/text-store')
210
208
 
211
 
 
212
209
    def _backup_control_dir(self):
213
210
        orig = self.base + '/.bzr'
214
211
        backup = orig + '.backup'
221
218
 
222
219
    def _convert_working_inv(self):
223
220
        branch = self.branch
224
 
        inv = serializer_v4.read_inventory(branch.controlfile('inventory', 'rb'))
 
221
        inv = serializer_v4.read_inventory(branch.control_files.controlfile('inventory', 'rb'))
225
222
        new_inv_xml = serializer_v5.write_inventory_to_string(inv)
226
 
        branch.put_controlfile('inventory', new_inv_xml)
 
223
        branch.control_files.put_controlfile('inventory', new_inv_xml)
227
224
 
228
225
 
229
226