~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Jelmer Vernooij
  • Date: 2011-03-03 12:50:21 UTC
  • mfrom: (5697 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5703.
  • Revision ID: jelmer@samba.org-20110303125021-ziry6a0qsr9l72x5
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 
38
38
import bzrlib
39
39
from bzrlib import (
40
 
    branch,
41
40
    config,
42
41
    controldir,
43
42
    errors,
2050
2049
            if target_branch is None:
2051
2050
                if do_upgrade:
2052
2051
                    # TODO: bad monkey, hard-coded formats...
2053
 
                    new_branch_format = branch.BzrBranchFormat7()
 
2052
                    from bzrlib.branch import BzrBranchFormat7
 
2053
                    new_branch_format = BzrBranchFormat7()
2054
2054
            else:
2055
2055
                new_branch_format = target_branch._format
2056
2056
                if not new_branch_format.supports_stacking():
2147
2147
controldir.ControlDirFormat._default_format = __default_format
2148
2148
 
2149
2149
 
2150
 
class Converter(object):
2151
 
    """Converts a disk format object from one format to another."""
2152
 
 
2153
 
    def convert(self, to_convert, pb):
2154
 
        """Perform the conversion of to_convert, giving feedback via pb.
2155
 
 
2156
 
        :param to_convert: The disk object to convert.
2157
 
        :param pb: a progress bar to use for progress information.
2158
 
        """
2159
 
 
2160
 
    def step(self, message):
2161
 
        """Update the pb by a step."""
2162
 
        self.count +=1
2163
 
        self.pb.update(message, self.count, self.total)
2164
 
 
2165
 
 
2166
 
class ConvertBzrDir4To5(Converter):
 
2150
class ConvertBzrDir4To5(controldir.Converter):
2167
2151
    """Converts format 4 bzr dirs to format 5."""
2168
2152
 
2169
2153
    def __init__(self):
2435
2419
        return order
2436
2420
 
2437
2421
 
2438
 
class ConvertBzrDir5To6(Converter):
 
2422
class ConvertBzrDir5To6(controldir.Converter):
2439
2423
    """Converts format 5 bzr dirs to format 6."""
2440
2424
 
2441
2425
    def convert(self, to_convert, pb):
2478
2462
            mode=self.bzrdir._get_file_mode())
2479
2463
 
2480
2464
 
2481
 
class ConvertBzrDir6ToMeta(Converter):
 
2465
class ConvertBzrDir6ToMeta(controldir.Converter):
2482
2466
    """Converts format 6 bzr dirs to metadirs."""
2483
2467
 
2484
2468
    def convert(self, to_convert, pb):
2601
2585
            self.file_mode)
2602
2586
 
2603
2587
 
2604
 
class ConvertMetaToMeta(Converter):
 
2588
class ConvertMetaToMeta(controldir.Converter):
2605
2589
    """Converts the components of metadirs."""
2606
2590
 
2607
2591
    def __init__(self, target_format):