~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Vincent Ladeuil
  • Date: 2010-02-05 10:27:33 UTC
  • mto: (5008.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5009.
  • Revision ID: v.ladeuil+lp@free.fr-20100205102733-8wpjnqz6g4nvrbfu
All Conflict action method names start with 'action_' to avoid potential namespace collisions

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
import os
31
31
import sys
32
 
import warnings
33
32
 
34
33
from bzrlib.lazy_import import lazy_import
35
34
lazy_import(globals(), """
2610
2609
    def convert(self, to_convert, pb):
2611
2610
        """See Converter.convert()."""
2612
2611
        self.bzrdir = to_convert
2613
 
        if pb is not None:
2614
 
            warnings.warn("pb parameter to convert() is deprecated")
2615
 
        self.pb = ui.ui_factory.nested_progress_bar()
2616
 
        try:
2617
 
            ui.ui_factory.note('starting upgrade from format 4 to 5')
2618
 
            if isinstance(self.bzrdir.transport, local.LocalTransport):
2619
 
                self.bzrdir.get_workingtree_transport(None).delete('stat-cache')
2620
 
            self._convert_to_weaves()
2621
 
            return BzrDir.open(self.bzrdir.root_transport.base)
2622
 
        finally:
2623
 
            self.pb.finished()
 
2612
        self.pb = pb
 
2613
        ui.ui_factory.note('starting upgrade from format 4 to 5')
 
2614
        if isinstance(self.bzrdir.transport, local.LocalTransport):
 
2615
            self.bzrdir.get_workingtree_transport(None).delete('stat-cache')
 
2616
        self._convert_to_weaves()
 
2617
        return BzrDir.open(self.bzrdir.root_transport.base)
2624
2618
 
2625
2619
    def _convert_to_weaves(self):
2626
2620
        ui.ui_factory.note('note: upgrade may be faster if all store files are ungzipped first')
2867
2861
    def convert(self, to_convert, pb):
2868
2862
        """See Converter.convert()."""
2869
2863
        self.bzrdir = to_convert
2870
 
        pb = ui.ui_factory.nested_progress_bar()
2871
 
        try:
2872
 
            ui.ui_factory.note('starting upgrade from format 5 to 6')
2873
 
            self._convert_to_prefixed()
2874
 
            return BzrDir.open(self.bzrdir.root_transport.base)
2875
 
        finally:
2876
 
            pb.finished()
 
2864
        self.pb = pb
 
2865
        ui.ui_factory.note('starting upgrade from format 5 to 6')
 
2866
        self._convert_to_prefixed()
 
2867
        return BzrDir.open(self.bzrdir.root_transport.base)
2877
2868
 
2878
2869
    def _convert_to_prefixed(self):
2879
2870
        from bzrlib.store import TransportStore
2912
2903
        from bzrlib.repofmt.weaverepo import RepositoryFormat7
2913
2904
        from bzrlib.branch import BzrBranchFormat5
2914
2905
        self.bzrdir = to_convert
2915
 
        self.pb = ui.ui_factory.nested_progress_bar()
 
2906
        self.pb = pb
2916
2907
        self.count = 0
2917
2908
        self.total = 20 # the steps we know about
2918
2909
        self.garbage_inventories = []
2998
2989
            'branch-format',
2999
2990
            BzrDirMetaFormat1().get_format_string(),
3000
2991
            mode=self.file_mode)
3001
 
        self.pb.finished()
3002
2992
        return BzrDir.open(self.bzrdir.root_transport.base)
3003
2993
 
3004
2994
    def make_lock(self, name):
3040
3030
    def convert(self, to_convert, pb):
3041
3031
        """See Converter.convert()."""
3042
3032
        self.bzrdir = to_convert
3043
 
        self.pb = ui.ui_factory.nested_progress_bar()
 
3033
        self.pb = pb
3044
3034
        self.count = 0
3045
3035
        self.total = 1
3046
3036
        self.step('checking repository format')
3106
3096
                isinstance(self.target_format.workingtree_format,
3107
3097
                    workingtree_4.WorkingTreeFormat6)):
3108
3098
                workingtree_4.Converter4or5to6().convert(tree)
3109
 
        self.pb.finished()
3110
3099
        return to_convert
3111
3100
 
3112
3101