~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-09-24 09:45:23 UTC
  • mfrom: (4712.1.4 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090924094523-nsz6mp3qwor3xpp3
(mbp) deprecate ProgressTask.note

Show diffs side-by-side

added added

removed removed

Lines of Context:
584
584
            # permissions as the .bzr directory (probably a bug in copy_tree)
585
585
            old_path = self.root_transport.abspath('.bzr')
586
586
            new_path = self.root_transport.abspath('backup.bzr')
587
 
            pb.note('making backup of %s' % (old_path,))
588
 
            pb.note('  to %s' % (new_path,))
 
587
            ui.ui_factory.note('making backup of %s\n  to %s' % (old_path, new_path,))
589
588
            self.root_transport.copy_tree('.bzr', 'backup.bzr')
590
589
            return (old_path, new_path)
591
590
        finally:
2611
2610
        """See Converter.convert()."""
2612
2611
        self.bzrdir = to_convert
2613
2612
        self.pb = pb
2614
 
        self.pb.note('starting upgrade from format 4 to 5')
 
2613
        ui.ui_factory.note('starting upgrade from format 4 to 5')
2615
2614
        if isinstance(self.bzrdir.transport, local.LocalTransport):
2616
2615
            self.bzrdir.get_workingtree_transport(None).delete('stat-cache')
2617
2616
        self._convert_to_weaves()
2618
2617
        return BzrDir.open(self.bzrdir.root_transport.base)
2619
2618
 
2620
2619
    def _convert_to_weaves(self):
2621
 
        self.pb.note('note: upgrade may be faster if all store files are ungzipped first')
 
2620
        ui.ui_factory.note('note: upgrade may be faster if all store files are ungzipped first')
2622
2621
        try:
2623
2622
            # TODO permissions
2624
2623
            stat = self.bzrdir.transport.stat('weaves')
2652
2651
        self.pb.clear()
2653
2652
        self._write_all_weaves()
2654
2653
        self._write_all_revs()
2655
 
        self.pb.note('upgraded to weaves:')
2656
 
        self.pb.note('  %6d revisions and inventories', len(self.revisions))
2657
 
        self.pb.note('  %6d revisions not present', len(self.absent_revisions))
2658
 
        self.pb.note('  %6d texts', self.text_count)
 
2654
        ui.ui_factory.note('upgraded to weaves:')
 
2655
        ui.ui_factory.note('  %6d revisions and inventories' % len(self.revisions))
 
2656
        ui.ui_factory.note('  %6d revisions not present' % len(self.absent_revisions))
 
2657
        ui.ui_factory.note('  %6d texts' % self.text_count)
2659
2658
        self._cleanup_spare_files_after_format4()
2660
2659
        self.branch._transport.put_bytes(
2661
2660
            'branch-format',
2729
2728
                       len(self.known_revisions))
2730
2729
        if not self.branch.repository.has_revision(rev_id):
2731
2730
            self.pb.clear()
2732
 
            self.pb.note('revision {%s} not present in branch; '
2733
 
                         'will be converted as a ghost',
 
2731
            ui.ui_factory.note('revision {%s} not present in branch; '
 
2732
                         'will be converted as a ghost' %
2734
2733
                         rev_id)
2735
2734
            self.absent_revisions.add(rev_id)
2736
2735
        else:
2863
2862
        """See Converter.convert()."""
2864
2863
        self.bzrdir = to_convert
2865
2864
        self.pb = pb
2866
 
        self.pb.note('starting upgrade from format 5 to 6')
 
2865
        ui.ui_factory.note('starting upgrade from format 5 to 6')
2867
2866
        self._convert_to_prefixed()
2868
2867
        return BzrDir.open(self.bzrdir.root_transport.base)
2869
2868
 
2871
2870
        from bzrlib.store import TransportStore
2872
2871
        self.bzrdir.transport.delete('branch-format')
2873
2872
        for store_name in ["weaves", "revision-store"]:
2874
 
            self.pb.note("adding prefixes to %s" % store_name)
 
2873
            ui.ui_factory.note("adding prefixes to %s" % store_name)
2875
2874
            store_transport = self.bzrdir.transport.clone(store_name)
2876
2875
            store = TransportStore(store_transport, prefixed=True)
2877
2876
            for urlfilename in store_transport.list_dir('.'):
2911
2910
        self.dir_mode = self.bzrdir._get_dir_mode()
2912
2911
        self.file_mode = self.bzrdir._get_file_mode()
2913
2912
 
2914
 
        self.pb.note('starting upgrade from format 6 to metadir')
 
2913
        ui.ui_factory.note('starting upgrade from format 6 to metadir')
2915
2914
        self.bzrdir.transport.put_bytes(
2916
2915
                'branch-format',
2917
2916
                "Converting to format 6",
2967
2966
        else:
2968
2967
            has_checkout = True
2969
2968
        if not has_checkout:
2970
 
            self.pb.note('No working tree.')
 
2969
            ui.ui_factory.note('No working tree.')
2971
2970
            # If some checkout files are there, we may as well get rid of them.
2972
2971
            for name, mandatory in checkout_files:
2973
2972
                if name in bzrcontents:
3042
3041
        else:
3043
3042
            if not isinstance(repo._format, self.target_format.repository_format.__class__):
3044
3043
                from bzrlib.repository import CopyConverter
3045
 
                self.pb.note('starting repository conversion')
 
3044
                ui.ui_factory.note('starting repository conversion')
3046
3045
                converter = CopyConverter(self.target_format.repository_format)
3047
3046
                converter.convert(repo, pb)
3048
3047
        try: