~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Martin Pool
  • Date: 2009-06-23 09:17:21 UTC
  • mto: (4712.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4715.
  • Revision ID: mbp@sourcefrog.net-20090623091721-ix4tpdsj2i9g1fxb
Deprecate ProgressTask.note

Show diffs side-by-side

added added

removed removed

Lines of Context:
577
577
            # permissions as the .bzr directory (probably a bug in copy_tree)
578
578
            old_path = self.root_transport.abspath('.bzr')
579
579
            new_path = self.root_transport.abspath('backup.bzr')
580
 
            pb.note('making backup of %s' % (old_path,))
581
 
            pb.note('  to %s' % (new_path,))
 
580
            ui.ui_factory.note('making backup of %s\n  to %s' % (old_path, new_path,))
582
581
            self.root_transport.copy_tree('.bzr', 'backup.bzr')
583
582
            return (old_path, new_path)
584
583
        finally:
2575
2574
        """See Converter.convert()."""
2576
2575
        self.bzrdir = to_convert
2577
2576
        self.pb = pb
2578
 
        self.pb.note('starting upgrade from format 4 to 5')
 
2577
        ui.ui_factory.note('starting upgrade from format 4 to 5')
2579
2578
        if isinstance(self.bzrdir.transport, local.LocalTransport):
2580
2579
            self.bzrdir.get_workingtree_transport(None).delete('stat-cache')
2581
2580
        self._convert_to_weaves()
2582
2581
        return BzrDir.open(self.bzrdir.root_transport.base)
2583
2582
 
2584
2583
    def _convert_to_weaves(self):
2585
 
        self.pb.note('note: upgrade may be faster if all store files are ungzipped first')
 
2584
        ui.ui_factory.note('note: upgrade may be faster if all store files are ungzipped first')
2586
2585
        try:
2587
2586
            # TODO permissions
2588
2587
            stat = self.bzrdir.transport.stat('weaves')
2616
2615
        self.pb.clear()
2617
2616
        self._write_all_weaves()
2618
2617
        self._write_all_revs()
2619
 
        self.pb.note('upgraded to weaves:')
2620
 
        self.pb.note('  %6d revisions and inventories', len(self.revisions))
2621
 
        self.pb.note('  %6d revisions not present', len(self.absent_revisions))
2622
 
        self.pb.note('  %6d texts', self.text_count)
 
2618
        ui.ui_factory.note('upgraded to weaves:')
 
2619
        ui.ui_factory.note('  %6d revisions and inventories' % len(self.revisions))
 
2620
        ui.ui_factory.note('  %6d revisions not present' % len(self.absent_revisions))
 
2621
        ui.ui_factory.note('  %6d texts' % self.text_count)
2623
2622
        self._cleanup_spare_files_after_format4()
2624
2623
        self.branch._transport.put_bytes(
2625
2624
            'branch-format',
2693
2692
                       len(self.known_revisions))
2694
2693
        if not self.branch.repository.has_revision(rev_id):
2695
2694
            self.pb.clear()
2696
 
            self.pb.note('revision {%s} not present in branch; '
2697
 
                         'will be converted as a ghost',
 
2695
            ui.ui_factory.note('revision {%s} not present in branch; '
 
2696
                         'will be converted as a ghost' %
2698
2697
                         rev_id)
2699
2698
            self.absent_revisions.add(rev_id)
2700
2699
        else:
2827
2826
        """See Converter.convert()."""
2828
2827
        self.bzrdir = to_convert
2829
2828
        self.pb = pb
2830
 
        self.pb.note('starting upgrade from format 5 to 6')
 
2829
        ui.ui_factory.note('starting upgrade from format 5 to 6')
2831
2830
        self._convert_to_prefixed()
2832
2831
        return BzrDir.open(self.bzrdir.root_transport.base)
2833
2832
 
2835
2834
        from bzrlib.store import TransportStore
2836
2835
        self.bzrdir.transport.delete('branch-format')
2837
2836
        for store_name in ["weaves", "revision-store"]:
2838
 
            self.pb.note("adding prefixes to %s" % store_name)
 
2837
            ui.ui_factory.note("adding prefixes to %s" % store_name)
2839
2838
            store_transport = self.bzrdir.transport.clone(store_name)
2840
2839
            store = TransportStore(store_transport, prefixed=True)
2841
2840
            for urlfilename in store_transport.list_dir('.'):
2875
2874
        self.dir_mode = self.bzrdir._get_dir_mode()
2876
2875
        self.file_mode = self.bzrdir._get_file_mode()
2877
2876
 
2878
 
        self.pb.note('starting upgrade from format 6 to metadir')
 
2877
        ui.ui_factory.note('starting upgrade from format 6 to metadir')
2879
2878
        self.bzrdir.transport.put_bytes(
2880
2879
                'branch-format',
2881
2880
                "Converting to format 6",
2931
2930
        else:
2932
2931
            has_checkout = True
2933
2932
        if not has_checkout:
2934
 
            self.pb.note('No working tree.')
 
2933
            ui.ui_factory.note('No working tree.')
2935
2934
            # If some checkout files are there, we may as well get rid of them.
2936
2935
            for name, mandatory in checkout_files:
2937
2936
                if name in bzrcontents:
3006
3005
        else:
3007
3006
            if not isinstance(repo._format, self.target_format.repository_format.__class__):
3008
3007
                from bzrlib.repository import CopyConverter
3009
 
                self.pb.note('starting repository conversion')
 
3008
                ui.ui_factory.note('starting repository conversion')
3010
3009
                converter = CopyConverter(self.target_format.repository_format)
3011
3010
                converter.convert(repo, pb)
3012
3011
        try: