/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 breezy/plugins/weave_fmt/bzrdir.py

  • Committer: Jelmer Vernooij
  • Date: 2018-04-02 00:52:27 UTC
  • mfrom: (6939 work)
  • mto: This revision was merged to the branch mainline in revision 7274.
  • Revision ID: jelmer@jelmer.uk-20180402005227-pecflp1mvdjrjqd6
Merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
116
116
    @classmethod
117
117
    def get_format_string(cls):
118
118
        """See BzrDirFormat.get_format_string()."""
119
 
        return "Bazaar-NG branch, format 5\n"
 
119
        return b"Bazaar-NG branch, format 5\n"
120
120
 
121
121
    def get_branch_format(self):
122
122
        from .branch import BzrBranchFormat4
180
180
    @classmethod
181
181
    def get_format_string(cls):
182
182
        """See BzrDirFormat.get_format_string()."""
183
 
        return "Bazaar-NG branch, format 6\n"
 
183
        return b"Bazaar-NG branch, format 6\n"
184
184
 
185
185
    def get_format_description(self):
186
186
        """See ControlDirFormat.get_format_description()."""
241
241
        self.controldir = to_convert
242
242
        if pb is not None:
243
243
            warnings.warn(gettext("pb parameter to convert() is deprecated"))
244
 
        self.pb = ui.ui_factory.nested_progress_bar()
245
 
        try:
 
244
        with ui.ui_factory.nested_progress_bar() as self.pb:
246
245
            ui.ui_factory.note(gettext('starting upgrade from format 4 to 5'))
247
246
            if isinstance(self.controldir.transport, local.LocalTransport):
248
247
                self.controldir.get_workingtree_transport(None).delete('stat-cache')
249
248
            self._convert_to_weaves()
250
249
            return ControlDir.open(self.controldir.user_url)
251
 
        finally:
252
 
            self.pb.finished()
253
250
 
254
251
    def _convert_to_weaves(self):
255
252
        ui.ui_factory.note(gettext(
508
505
    def convert(self, to_convert, pb):
509
506
        """See Converter.convert()."""
510
507
        self.controldir = to_convert
511
 
        pb = ui.ui_factory.nested_progress_bar()
512
 
        try:
 
508
        with ui.ui_factory.nested_progress_bar() as pb:
513
509
            ui.ui_factory.note(gettext('starting upgrade from format 5 to 6'))
514
510
            self._convert_to_prefixed()
515
511
            return ControlDir.open(self.controldir.user_url)
516
 
        finally:
517
 
            pb.finished()
518
512
 
519
513
    def _convert_to_prefixed(self):
520
514
        from .store import TransportStore
626
620
            self.step(gettext('Upgrading working tree'))
627
621
            self.controldir.transport.mkdir('checkout', mode=self.dir_mode)
628
622
            self.make_lock('checkout')
629
 
            self.put_format(
630
 
                'checkout', WorkingTreeFormat3())
631
 
            self.controldir.transport.delete_multi(
632
 
                self.garbage_inventories, self.pb)
 
623
            self.put_format('checkout', WorkingTreeFormat3())
 
624
            for path in self.garbage_inventories:
 
625
                self.controldir.transport.delete(path)
633
626
            for entry in checkout_files:
634
627
                self.move_entry('checkout', entry)
635
628
            if last_revision is not None:
689
682
    @classmethod
690
683
    def get_format_string(cls):
691
684
        """See BzrDirFormat.get_format_string()."""
692
 
        return "Bazaar-NG branch, format 0.0.4\n"
 
685
        return b"Bazaar-NG branch, format 0.0.4\n"
693
686
 
694
687
    def get_format_description(self):
695
688
        """See ControlDirFormat.get_format_description()."""