~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Robert Collins
  • Date: 2006-02-17 04:17:09 UTC
  • mto: (1534.1.24 integration)
  • mto: This revision was merged to the branch mainline in revision 1554.
  • Revision ID: robertc@robertcollins.net-20060217041709-7251eb701f69ca7e
Review feedback.

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
        a transport connected to the directory this bzr was opened from.
62
62
    """
63
63
 
64
 
    def can_update_format(self):
65
 
        """Return true if this bzrdir is one whose format we can update."""
 
64
    def can_convert_format(self):
 
65
        """Return true if this bzrdir is one whose format we can convert from."""
66
66
        return True
67
67
 
68
68
    def _check_supported(self, format, allow_unsupported):
362
362
        self.transport = _transport.clone('.bzr')
363
363
        self.root_transport = _transport
364
364
 
365
 
    def needs_format_update(self, format=None):
366
 
        """Return true if this bzrdir needs update_format run on it.
 
365
    def needs_format_conversion(self, format=None):
 
366
        """Return true if this bzrdir needs convert_format run on it.
367
367
        
368
368
        For instance, if the repository format is out of date but the 
369
369
        branch and working tree are not, this should return True.
370
370
 
371
371
        :param format: Optional parameter indicating a specific desired
372
 
                       format we want to end up at.
 
372
                       format we plan to arrive at.
373
373
        """
374
374
        # for now, if the format is not the same as the system default,
375
375
        # an upgrade is needed. In the future we will want to scan
648
648
        from bzrlib.repository import RepositoryFormat4
649
649
        return RepositoryFormat4().initialize(self, shared)
650
650
 
651
 
    def needs_format_update(self, format=None):
652
 
        """Format 4 dirs are always in need of updating."""
 
651
    def needs_format_conversion(self, format=None):
 
652
        """Format 4 dirs are always in need of conversion."""
653
653
        return True
654
654
 
655
655
    def open_repository(self):
699
699
    individual formats are really split out.
700
700
    """
701
701
 
702
 
    def can_update_format(self):
703
 
        """See BzrDir.can_update_format()."""
 
702
    def can_convert_format(self):
 
703
        """See BzrDir.can_convert_format()."""
704
704
        return False
705
705
 
706
706
    def create_branch(self):
760
760
            pass
761
761
        return self.transport.clone('checkout')
762
762
 
763
 
    def needs_format_update(self, format=None):
764
 
        """See BzrDir.needs_format_update()."""
765
 
        # currently there are no possible updates to meta1 formats.
 
763
    def needs_format_conversion(self, format=None):
 
764
        """See BzrDir.needs_format_conversion()."""
 
765
        # currently there are no possible conversions for meta1 formats.
766
766
        return False
767
767
 
768
768
    def open_branch(self, unsupported=False):
830
830
        """Return the ASCII format string that identifies this format."""
831
831
        raise NotImplementedError(self.get_format_string)
832
832
 
833
 
    def get_updater(self, format=None):
834
 
        """Return the updater to use to convert bzrdirs needing updates.
 
833
    def get_converter(self, format=None):
 
834
        """Return the converter to use to convert bzrdirs needing converts.
835
835
 
836
836
        This returns a bzrlib.bzrdir.Converter object.
837
837
 
842
842
        :param format: Optional format to override the default foramt of the 
843
843
                       library.
844
844
        """
845
 
        raise NotImplementedError(self.get_updater)
 
845
        raise NotImplementedError(self.get_converter)
846
846
 
847
847
    def initialize(self, url):
848
848
        """Create a bzr control dir at this url and return an opened copy."""
936
936
        """See BzrDirFormat.get_format_string()."""
937
937
        return "Bazaar-NG branch, format 0.0.4\n"
938
938
 
939
 
    def get_updater(self, format=None):
940
 
        """See BzrDirFormat.get_updater()."""
 
939
    def get_converter(self, format=None):
 
940
        """See BzrDirFormat.get_converter()."""
941
941
        # there is one and only one upgrade path here.
942
942
        return ConvertBzrDir4To5()
943
943
        
974
974
        """See BzrDirFormat.get_format_string()."""
975
975
        return "Bazaar-NG branch, format 5\n"
976
976
 
977
 
    def get_updater(self, format=None):
978
 
        """See BzrDirFormat.get_updater()."""
 
977
    def get_converter(self, format=None):
 
978
        """See BzrDirFormat.get_converter()."""
979
979
        # there is one and only one upgrade path here.
980
980
        return ConvertBzrDir5To6()
981
981
        
1013
1013
        """See BzrDirFormat.get_format_string()."""
1014
1014
        return "Bazaar-NG branch, format 6\n"
1015
1015
 
1016
 
    def get_updater(self, format=None):
1017
 
        """See BzrDirFormat.get_updater()."""
 
1016
    def get_converter(self, format=None):
 
1017
        """See BzrDirFormat.get_converter()."""
1018
1018
        # there is one and only one upgrade path here.
1019
1019
        return ConvertBzrDir6ToMeta()
1020
1020