b.upgrade : module documentation

Part of bzrlib

bzr upgrade logic.
Class Convert No class docstring; 2/3 methods documented
Function upgrade Upgrade locations to format.
Function smart_upgrade Convert control directories to a new format intelligently.
Function _smart_upgrade_one Convert a control directory to a new format intelligently.
Function _get_object_and_label Return the primary object and type label for a control directory.
Function _convert_items Convert a sequence of control directories to the given format.
def upgrade(url, format=None, clean_up=False, dry_run=False):
Upgrade locations to format.

This routine wraps the smart_upgrade() routine with a nicer UI. In particular, it ensures all URLs can be opened before starting and reports a summary at the end if more than one upgrade was attempted. This routine is useful for command line tools. Other bzrlib clients probably ought to use smart_upgrade() instead.

Parametersurla URL of the locations to upgrade.
formatthe format to convert to or None for the best default
clean-upif True, the backup.bzr directory is removed if the upgrade succeeded for a given repo/branch/tree
dry_runshow what would happen but don't actually do any upgrades
Returnsthe list of exceptions encountered
def smart_upgrade(control_dirs, format, clean_up=False, dry_run=False):
Convert control directories to a new format intelligently.

If the control directory is a shared repository, dependent branches are also converted provided the repository converted successfully. If the conversion of a branch fails, remaining branches are still tried.

Parameterscontrol_dirsthe BzrDirs to upgrade
formatthe format to convert to or None for the best default
clean_upif True, the backup.bzr directory is removed if the upgrade succeeded for a given repo/branch/tree
dry_runshow what would happen but don't actually do any upgrades
Returnsattempted-control-dirs, succeeded-control-dirs, exceptions
def _smart_upgrade_one(control_dir, format, clean_up=False, dry_run=False):
Convert a control directory to a new format intelligently.

See smart_upgrade for parameter details.

def _get_object_and_label(control_dir):
Return the primary object and type label for a control directory.

:return: object, label where:
  * object is a Branch, Repository or WorkingTree and
  * label is one of:
    * branch            - a branch
    * repository        - a repository
    * tree              - a lightweight checkout
def _convert_items(items, format, clean_up, dry_run, label=None):
Convert a sequence of control directories to the given format.
Parametersitemsthe control directories to upgrade
formatthe format to convert to or None for the best default
clean-upif True, the backup.bzr directory is removed if the upgrade succeeded for a given repo/branch/tree
dry_runshow what would happen but don't actually do any upgrades
labelthe label for these items or None to calculate one
Returnsitems successfully upgraded, exceptions
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.