l.c.bzrutils : module documentation

Part of lp.codehosting

Utilities for dealing with Bazaar.

Much of the code in here should be submitted upstream. The rest is code that integrates between Bazaar's infrastructure and Launchpad's infrastructure.

Function should_log_oops Return true if exc should trigger an OOPS.
Function is_branch_stackable Return True if the bzr_branch is able to be stacked.
Function get_branch_stacked_on_url Return the stacked-on URL for the branch in this bzrdir.
Function add_exception_logging_hook Call 'hook_function' when bzr logs an exception.
Function remove_exception_logging_hook Cease calling 'hook_function' whenever bzr logs an exception.
Function make_oops_logging_exception_hook Make a hook for logging OOPSes.
Class BazaarOopsRequest An OOPS request specific to bzr.
Function make_error_utility Make an error utility for logging errors from bzr.
Function install_oops_handler Install an OOPS handler for a bzr process.
Class HttpAsLocalTransport A LocalTransport that works using http URLs.
Class DenyingServer Temporarily prevent creation of transports for certain URL schemes.
Function get_vfs_format_classes Return the vfs classes of the branch, repo and bzrdir formats.
Function identical_formats Check if two branches have the same bzrdir, repo, and branch formats.
Function get_stacked_on_url Get the stacked-on URL for 'branch', or None if not stacked.
Function get_branch_info Get information about the branch for branchChanged.
Function read_locked Undocumented
Function write_locked Provide a context in which the branch is write-locked.
Function server Undocumented
Function _hooked_log_exception_quietly Wrapper around trace.log_exception_quietly that calls hooks.
def should_log_oops(exc):
Return true if exc should trigger an OOPS.
def is_branch_stackable(bzr_branch):
Return True if the bzr_branch is able to be stacked.
def get_branch_stacked_on_url(a_bzrdir):
Return the stacked-on URL for the branch in this bzrdir.

This method lets you figure out the stacked-on URL of a branch without opening the stacked-on branch. This lets us check for pathologically stacked branches.

Returnsthe stacked-on URL for the branch in this bzrdir.
RaisesNotBranchErrorIf there is no Branch.
NotStackedIf the Branch is not stacked.
UnstackableBranchFormatIf the Branch is of an unstackable format.
def _hooked_log_exception_quietly():
Wrapper around trace.log_exception_quietly that calls hooks.
def add_exception_logging_hook(hook_function):
Call 'hook_function' when bzr logs an exception.
Parametershook_functionA nullary callable that relies on sys.exc_info() for exception information.
def remove_exception_logging_hook(hook_function):
Cease calling 'hook_function' whenever bzr logs an exception.
Parametershook_functionA nullary callable that relies on sys.exc_info() for exception information. It will be removed from the exception logging hooks.
def make_oops_logging_exception_hook(error_utility, request):
Make a hook for logging OOPSes.
def make_error_utility(pid=None):
Make an error utility for logging errors from bzr.
def install_oops_handler(user_id):
Install an OOPS handler for a bzr process.

When installed, logs any exception passed to log_exception_quietly.

Parametersuser_idThe database ID of the user the process is running as.
def get_vfs_format_classes(branch):
Return the vfs classes of the branch, repo and bzrdir formats.

'vfs' here means that it will return the underlying format classes of a remote branch.

def identical_formats(branch_one, branch_two):
Check if two branches have the same bzrdir, repo, and branch formats.
def get_stacked_on_url(branch):
Get the stacked-on URL for 'branch', or None if not stacked.
def get_branch_info(branch):
Get information about the branch for branchChanged.
Returnsa dict containing 'stacked_on_url', 'last_revision_id', 'control_string', 'branch_string', 'repository_string'.
@contextmanager
def read_locked(branch):
Undocumented
@contextmanager
def write_locked(branch):
Provide a context in which the branch is write-locked.
@contextmanager
def server(server, no_replace=False):
Undocumented
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.