~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/upgrade.py

  • Committer: Robert Collins
  • Date: 2005-10-02 21:51:29 UTC
  • mfrom: (1396)
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20051002215128-5686c7d24bf9bdb9
merge from martins newformat branch - brings in transport abstraction

Show diffs side-by-side

added added

removed removed

Lines of Context:
149
149
 
150
150
 
151
151
    def _open_branch(self):
152
 
        self.branch = Branch(self.base, relax_version_check=True)
 
152
        self.branch = Branch.open_downlevel(self.base)
153
153
        if self.branch._branch_format == 5:
154
154
            note('this branch is already in the most current format')
155
155
            return False
160
160
 
161
161
 
162
162
    def _set_new_format(self):
163
 
        f = self.branch.controlfile('branch-format', 'wb')
164
 
        try:
165
 
            f.write(BZR_BRANCH_FORMAT_5)
166
 
        finally:
167
 
            f.close()
 
163
        self.branch.put_controlfile('branch-format', BZR_BRANCH_FORMAT_5)
168
164
 
169
165
 
170
166
    def _cleanup_spare_files(self):
191
187
    def _convert_working_inv(self):
192
188
        branch = self.branch
193
189
        inv = serializer_v4.read_inventory(branch.controlfile('inventory', 'rb'))
194
 
        serializer_v5.write_inventory(inv, branch.controlfile('inventory', 'wb'))
 
190
        new_inv_xml = serializer_v5.write_inventory_to_string(inv)
 
191
        branch.put_controlfile('inventory', new_inv_xml)
195
192
 
196
193
 
197
194