b.r.RepositoryFormat(controldir.ControlComponentFormat) : class documentation

Part of bzrlib.repository View In Hierarchy

Known subclasses: bzrlib.repository.MetaDirRepositoryFormat, bzrlib.tests.per_bzrdir.test_bzrdir.AnonymousTestRepositoryFormat, bzrlib.tests.per_bzrdir.test_bzrdir.IdentifiableTestRepositoryFormat, bzrlib.tests.test_repository.SampleExtraRepositoryFormat, bzrlib.tests.test_repository.SampleRepositoryFormat, bzrlib.vf_repository.VersionedFileRepositoryFormat

A repository format.

Formats provide four things:
  • An initialization routine to construct repository data on disk.
  • a optional format string which is used when the BzrDir supports versioned children.
  • an open routine which returns a Repository instance.
  • A network name for referring to the format in smart server RPC methods.

There is one and only one Format subclass for each on-disk format. But there can be one Repository subclass that is used for several different formats. The _format attribute on a Repository instance can be used to determine the disk format.

Formats are placed in a registry by their format string for reference during opening. These should be subclasses of RepositoryFormat for consistency.

Once a format is deprecated, just deprecate the initialize and open methods on the format class. Do not deprecate the object, as the object may be created even when a repository instance hasn't been created.

Common instance attributes: _matchingbzrdir - the controldir format that the repository format was originally written to work with. This can be used if manually constructing a bzrdir and repository, or more commonly for test suite parameterization.

Method __repr__ Undocumented
Method __eq__ Undocumented
Method __ne__ Undocumented
Class Method find_format Return the format for the repository object in a_bzrdir.
Class Method register_format Undocumented
Class Method unregister_format Undocumented
Class Method get_default_format Return the current default format.
Method get_format_string Return the ASCII format string that identifies this format.
Method get_format_description Return the short description for this format.
Method initialize Initialize a repository of this format in controldir.
Method is_supported Is this format supported?
Method is_deprecated Is this format deprecated?
Method network_name A simple byte string uniquely identifying this format for RPC calls.
Method check_conversion_target Undocumented
Method open Return an instance of this format for a controldir.
Method _run_post_repo_init_hooks Undocumented
def __repr__(self):
Undocumented
def __eq__(self, other):
Undocumented
def __ne__(self, other):
Undocumented
@classmethod
def find_format(klass, a_bzrdir):
Return the format for the repository object in a_bzrdir.

This is used by bzr native formats that have a "format" file in the repository. Other methods may be used by different types of control directory.

@classmethod
@symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4, 0)))
def register_format(klass, format):
Undocumented
@classmethod
@symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4, 0)))
def unregister_format(klass, format):
Undocumented
@classmethod
@symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4, 0)))
def get_default_format(klass):
Return the current default format.
def get_format_string(self):
overridden in bzrlib.plugins.weave_fmt.repository.RepositoryFormat7, bzrlib.plugins.weave_fmt.repository.RepositoryFormat7, bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a, bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack1, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack1, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack3, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack3, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack4, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack4, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack5, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack5, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack5RichRoot, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack5RichRoot, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack5RichRootBroken, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack5RichRootBroken, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack6, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack6, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack6RichRoot, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack6RichRoot, bzrlib.repofmt.knitpack_repo.RepositoryFormatPackDevelopment2Subtree, bzrlib.repofmt.knitpack_repo.RepositoryFormatPackDevelopment2Subtree, bzrlib.repofmt.knitrepo.RepositoryFormatKnit1, bzrlib.repofmt.knitrepo.RepositoryFormatKnit1, bzrlib.repofmt.knitrepo.RepositoryFormatKnit3, bzrlib.repofmt.knitrepo.RepositoryFormatKnit3, bzrlib.repofmt.knitrepo.RepositoryFormatKnit4, bzrlib.repofmt.knitrepo.RepositoryFormatKnit4, bzrlib.tests.per_bzrdir.test_bzrdir.AnonymousTestRepositoryFormat, bzrlib.tests.per_bzrdir.test_bzrdir.IdentifiableTestRepositoryFormat, bzrlib.tests.test_repository.SampleExtraRepositoryFormat, bzrlib.tests.test_repository.SampleRepositoryFormat
Return the ASCII format string that identifies this format.

Note that in pre format ?? repositories the format string is not permitted nor written to disk.

def get_format_description(self):
overridden in bzrlib.plugins.weave_fmt.repository.RepositoryFormat4, bzrlib.plugins.weave_fmt.repository.RepositoryFormat5, bzrlib.plugins.weave_fmt.repository.RepositoryFormat6, bzrlib.plugins.weave_fmt.repository.RepositoryFormat7, bzrlib.plugins.weave_fmt.repository.RepositoryFormat7, bzrlib.remote.RemoteRepositoryFormat, bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a, bzrlib.repofmt.groupcompress_repo.RepositoryFormat2a, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack1, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack1, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack3, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack3, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack4, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack4, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack5, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack5, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack5RichRoot, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack5RichRoot, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack5RichRootBroken, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack5RichRootBroken, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack6, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack6, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack6RichRoot, bzrlib.repofmt.knitpack_repo.RepositoryFormatKnitPack6RichRoot, bzrlib.repofmt.knitpack_repo.RepositoryFormatPackDevelopment2Subtree, bzrlib.repofmt.knitpack_repo.RepositoryFormatPackDevelopment2Subtree, bzrlib.repofmt.knitrepo.RepositoryFormatKnit1, bzrlib.repofmt.knitrepo.RepositoryFormatKnit1, bzrlib.repofmt.knitrepo.RepositoryFormatKnit3, bzrlib.repofmt.knitrepo.RepositoryFormatKnit3, bzrlib.repofmt.knitrepo.RepositoryFormatKnit4, bzrlib.repofmt.knitrepo.RepositoryFormatKnit4
Return the short description for this format.
def initialize(self, controldir, shared=False):
Initialize a repository of this format in controldir.

This may raise UninitializableFormat if shared repository are not compatible the controldir.

ParameterscontroldirThe controldir to put the new repository in it.
sharedThe repository should be initialized as a sharable one.
ReturnsThe new repository object.
def is_supported(self):
Is this format supported?

Supported formats must be initializable and openable. Unsupported formats may not support initialization or committing or some other features depending on the reason for not being supported.

def is_deprecated(self):
Is this format deprecated?

Deprecated formats may trigger a user-visible warning recommending the user to upgrade. They are still fully supported.

def network_name(self):
A simple byte string uniquely identifying this format for RPC calls.

MetaDir repository formats use their disk format string to identify the repository over the wire. All in one formats such as bzr < 0.8, and foreign formats like svn/git and hg should use some marker which is unique and immutable.

def check_conversion_target(self, target_format):
Undocumented
def open(self, controldir, _found=False):
Return an instance of this format for a controldir.

_found is a private parameter, do not use it.

def _run_post_repo_init_hooks(self, repository, controldir, shared):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.