~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 01:03:13 UTC
  • mto: This revision was merged to the branch mainline in revision 5697.
  • Revision ID: jelmer@samba.org-20110303010313-3d56xyh0es8k4emw
Move Converter (which is generic) from bzrlib.bzrdir to bzrlib.controldir.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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):