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
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 |
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.
Note that in pre format ?? repositories the format string is not permitted nor written to disk.
This may raise UninitializableFormat if shared repository are not compatible the controldir.
Parameters | controldir | The controldir to put the new repository in it. |
shared | The repository should be initialized as a sharable one. | |
Returns | The new repository object. |
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.
Deprecated formats may trigger a user-visible warning recommending the user to upgrade. They are still fully supported.
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.
_found is a private parameter, do not use it.