Part of bzrlib
Developer documentation is available at http://doc.bazaar.canonical.com/bzr.dev/developers/
The project website is at http://bazaar.canonical.com/
Some particularly interesting things in bzrlib are:
- bzrlib.initialize -- setup the library for use
- bzrlib.plugin.load_plugins -- load all installed plugins
- bzrlib.branch.Branch.open -- open a branch
- bzrlib.workingtree.WorkingTree.open -- open a working tree
We hope you enjoy this library.
Function | initialize | Set up everything needed for normal use of bzrlib. |
Function | test_suite | Undocumented |
Function | _format_version_tuple | Turn a version number 2, 3 or 5-tuple into a short string. |
Turn a version number 2, 3 or 5-tuple into a short string.
This format matches <http://docs.python.org/dist/meta-data.html> and the typical presentation used in Python output.
This also checks that the version is reasonable: the sub-release must be zero for final releases.
>>> print _format_version_tuple((1, 0, 0, 'final', 0)) 1.0.0 >>> print _format_version_tuple((1, 2, 0, 'dev', 0)) 1.2.0dev >>> print _format_version_tuple((1, 2, 0, 'dev', 1)) 1.2.0dev1 >>> print _format_version_tuple((1, 1, 1, 'candidate', 2)) 1.1.1rc2 >>> print _format_version_tuple((2, 1, 0, 'beta', 1)) 2.1b1 >>> print _format_version_tuple((1, 4, 0)) 1.4.0 >>> print _format_version_tuple((1, 4)) 1.4 >>> print _format_version_tuple((2, 1, 0, 'final', 42)) 2.1.0.42 >>> print _format_version_tuple((1, 4, 0, 'wibble', 0)) 1.4.0.wibble.0
Most applications that embed bzrlib, including bzr itself, should call this function to initialize various subsystems.
More options may be added in future so callers should use named arguments.
The object returned by this function can be used as a contex manager through the 'with' statement to automatically shut down when the process is finished with bzrlib. However (from bzr 2.4) it's not necessary to separately enter the context as well as starting bzr: bzrlib is ready to go when this function returns.
Parameters | setup_ui | If true (default) use a terminal UI; otherwise
some other ui_factory must be assigned to bzrlib.ui.ui_factory by
the caller. |
stdin, stdout, stderr | If provided, use these for terminal IO;
otherwise use the files in sys . | |
Returns | A context manager for the use of bzrlib. The __exit__ should be called by the caller before exiting their process or otherwise stopping use of bzrlib. Advanced callers can use BzrLibraryState directly. |