b.r.RemoteBranch(branch.Branch, _RpcHelper, lock._RelockDebugMixin) : class documentation

Part of bzrlib.remote View In Hierarchy

Branch stored on a server accessed by HPSS RPC.

At the moment most operations are mapped down to simple file operations.

Method __init__ Create a RemoteBranch instance.
Method __str__ Undocumented
Method control_files Undocumented
Method get_physical_lock_status See Branch.get_physical_lock_status().
Method get_stacked_on_url Get the URL this branch is stacked against.
Method set_stacked_on_url Set the URL this branch is stacked against.
Method lock_read Lock the branch for read operations.
Method lock_write Lock the branch for write operations.
Method unlock Undocumented
Method break_lock Break a lock if one is present from another instance.
Method leave_lock_in_place Tell this branch object not to release the physical lock when this
Method dont_leave_lock_in_place Tell this branch object to release the physical lock when this
Method get_rev_id Find the revision id of the specified revno.
Method set_revision_history See Branch.set_revision_history.
Method pull Mirror source into this branch.
Method push Mirror this branch into target.
Method is_locked Undocumented
Method revision_id_to_revno Given a revision id, return its revno
Method set_last_revision_info Set the last revision of this branch.
Method generate_revision_history See Branch.generate_revision_history
Method set_push_location Set a new push location for this branch.
Method heads_to_fetch Return the heads that must and that should be fetched to copy this
Method _setup_stacking Undocumented
Method _get_config Get the concrete config for just the config in this branch.
Method _get_real_transport Undocumented
Method _ensure_real Ensure that there is a _real_branch set.
Method _translate_error Undocumented
Method _clear_cached_state Clear any cached data on this branch, e.g. cached revision history.
Method _clear_cached_state_of_remote_branch_only Like _clear_cached_state, but doesn't clear the cache of
Method _get_checkout_format Return the most suitable metadir for a checkout of this branch.
Method _vfs_get_tags_bytes Undocumented
Method _get_tags_bytes Get the bytes of a serialised tags dict.
Method _get_tags_bytes_via_hpss Undocumented
Method _vfs_set_tags_bytes Undocumented
Method _set_tags_bytes Mirror method for _get_tags_bytes.
Method _remote_lock_write Undocumented
Method _unlock Undocumented
Method _read_last_revision_info Undocumented
Method _gen_revision_history See Branch._gen_revision_history().
Method _remote_path Undocumented
Method _set_last_revision_descendant Undocumented
Method _set_last_revision Undocumented
Method _set_revision_history Undocumented
Method _get_parent_location Undocumented
Method _vfs_get_parent_location Undocumented
Method _set_parent_location Undocumented
Method _vfs_set_parent_location Undocumented
Method _rpc_heads_to_fetch Undocumented
Method _vfs_heads_to_fetch Undocumented

Inherited from Branch:

Method control_transport Undocumented
Method user_transport Undocumented
Static Method open Open the branch rooted at base.
Static Method open_from_transport Open the branch rooted at transport
Static Method open_containing Open an existing branch which contains url.
Method get_config Get a bzrlib.config.BranchConfig for this Branch.
Method get_config_stack Get a bzrlib.config.BranchStack for this Branch.
Method peek_lock_mode Return lock mode for the Branch: 'r', 'w' or None
Method dotted_revno_to_revision_id Return the revision_id for a dotted revno.
Method revision_id_to_dotted_revno Given a revision id, return its dotted revno.
Method get_revision_id_to_revno_map Return the revision_id => dotted revno map.
Method iter_merge_sorted_revisions Walk the revisions for a branch in merge sorted order.
Method bind Bind the local branch the other branch.
Method get_append_revisions_only Whether it is only possible to append revisions to the history.
Method set_append_revisions_only Undocumented
Method set_reference_info Set the branch location to use for a tree reference.
Method get_reference_info Get the tree_path and branch_location for a tree reference.
Method fetch Copy revisions from from_branch into this branch.
Method get_bound_location Return the URL of the branch we are bound to.
Method get_old_bound_location Return the URL of the branch we used to be bound to
Method get_commit_builder Obtain a CommitBuilder for this branch.
Method get_master_branch Return the branch we are bound to.
Method get_revision_delta Return the delta for one revision.
Method print_file Print file to stdout.
Method set_parent See Branch.set_parent.
Method revision_history Return sequence of revision ids on this branch.
Method revno Return current revision number for this branch.
Method unbind Older format branches cannot bind or unbind.
Method last_revision Return last revision id, or NULL_REVISION.
Method last_revision_info Return information about the last revision.
Method import_last_revision_info Set the last revision info, importing from another repo if necessary.
Method import_last_revision_info_and_tags Set the last revision info, importing from another repo if necessary.
Method basis_tree Return Tree object for last revision.
Method get_parent Return the parent location of the branch.
Method get_child_submit_format Return the preferred format of submissions to this branch.
Method get_submit_branch Return the submit location of the branch.
Method set_submit_branch Return the submit location of the branch.
Method get_public_branch Return the public location of the branch.
Method set_public_branch Return the submit location of the branch.
Method get_push_location Return the None or the location to push this branch to.
Method update Synchronise this branch with the master branch if any.
Method check_revno Check whether a revno corresponds to any revision.
Method check_real_revno Check whether a revno corresponds to a real revision.
Method clone Clone this branch into to_bzrdir preserving all semantic values.
Method sprout Create a new line of development from the branch, into to_bzrdir.
Method copy_content_into Copy the content of self into destination.
Method update_references Undocumented
Method check Check consistency of the branch.
Method create_clone_on_transport Create a clone of this branch and its bzrdir.
Method create_checkout Create a checkout of a branch.
Method reconcile Make sure the data stored in this branch is consistent.
Method reference_parent Return the parent branch for a tree-reference file_id
Method supports_tags Undocumented
Method automatic_tag_name Try to automatically find the tag name for a revision.
Method _open_hook Called by init to allow simpler extension of the base class.
Method _activate_fallback_location Activate the branch/repository from url as a fallback repository.
Method _check_stackable_repo Undocumented
Method _extend_partial_history Extend the partial history to include a given index
Method _get_check_refs Get the references needed for check().
Method _push_should_merge_tags Should _basic_push merge this branch's tags into the target?
Method _get_fallback_repository Get the repository we fallback to at url.
Method _get_nick Undocumented
Method _set_nick Undocumented
Method _lefthand_history Undocumented
Method _do_dotted_revno_to_revision_id Worker function for dotted_revno_to_revision_id.
Method _do_revision_id_to_dotted_revno Worker function for revision_id_to_revno.
Method _gen_revno_map Create a new mapping from revision ids to dotted revnos.
Method _filter_merge_sorted_revisions Iterate over an inclusive range of sorted revisions.
Method _filter_start_non_ancestors Undocumented
Method _unstack Change a branch to be unstacked, copying data as needed.
Method _set_tags_bytes_locked Undocumented
Method _cache_revision_history Set the cached revision history to rev_history.
Method _cache_revision_id_to_revno Set the cached revision_id => revno map to revision_id_to_revno.
Method _revision_history Undocumented
Method _set_config_location Undocumented
Method _get_config_location Undocumented
Method _run_post_change_branch_tip_hooks Run the post_change_branch_tip hooks.
Method _run_pre_change_branch_tip_hooks Run the pre_change_branch_tip hooks.
Method _synchronize_history Synchronize last revision and revision history between branches.
Method _check_if_descendant_or_diverged Ensure that revision_b is a descendant of revision_a.
Method _revision_relations Determine the relationship between two revisions.

Inherited from ControlComponent (via Branch):

Method control_url Undocumented
Method user_url Undocumented

Inherited from _RpcHelper:

Method _call Undocumented
Method _call_expecting_body Undocumented
Method _call_with_body_bytes Undocumented
Method _call_with_body_bytes_expecting_body Undocumented

Inherited from _RelockDebugMixin:

Method _note_lock Undocumented
def __init__(self, remote_bzrdir, remote_repository, real_branch=None, _client=None, format=None, setup_stacking=True, name=None):
Create a RemoteBranch instance.
Parametersreal_branchAn optional local implementation of the branch format, usually accessing the data via the VFS.
_clientPrivate parameter for testing.
formatA RemoteBranchFormat object, None to create one automatically. If supplied it should have a network_name already supplied.
setup_stackingIf True make an RPC call to determine the stacked (or not) status of the branch. If False assume the branch is not stacked.
nameColocated branch name
def _setup_stacking(self):
Undocumented
def _get_config(self):
Get the concrete config for just the config in this branch.

This is not intended for client use; see Branch.get_config for the public API.

Added in 1.14.

ReturnsAn object supporting get_option and set_option.
def _get_real_transport(self):
Undocumented
def __str__(self):
Undocumented
def _ensure_real(self):
Ensure that there is a _real_branch set.

Used before calls to self._real_branch.

def _translate_error(self, err, **context):
Undocumented
def _clear_cached_state(self):
Clear any cached data on this branch, e.g. cached revision history.

This means the next call to revision_history will need to call _gen_revision_history.

This API is semi-public; it only for use by subclasses, all other code should consider it to be private.

def _clear_cached_state_of_remote_branch_only(self):
Like _clear_cached_state, but doesn't clear the cache of self._real_branch.

This is useful when falling back to calling a method of self._real_branch that changes state. In that case the underlying branch changes, so we need to invalidate this RemoteBranch's cache of it. However, there's no need to invalidate the _real_branch's cache too, in fact doing so might harm performance.

@property
def control_files(self):
Undocumented
def _get_checkout_format(self, lightweight=False):
Return the most suitable metadir for a checkout of this branch. Weaves are used if this branch's repository uses weaves.
def get_physical_lock_status(self):
See Branch.get_physical_lock_status().
def get_stacked_on_url(self):
Get the URL this branch is stacked against.
RaisesNotStackedIf the branch is not stacked.
UnstackableBranchFormatIf the branch does not support stacking.
UnstackableRepositoryFormatIf the repository does not support stacking.
def set_stacked_on_url(self, url):
Set the URL this branch is stacked against.
RaisesUnstackableBranchFormatIf the branch does not support stacking.
UnstackableRepositoryFormatIf the repository does not support stacking.
def _vfs_get_tags_bytes(self):
Undocumented
@needs_read_lock
def _get_tags_bytes(self):
Get the bytes of a serialised tags dict.

Note that not all branches support tags, nor do all use the same tags logic: this method is specific to BasicTags. Other tag implementations may use the same method name and behave differently, safely, because of the double-dispatch via format.make_tags->tags_instance->get_tags_dict.

ReturnsThe bytes of the tags file.
See AlsoBranch._set_tags_bytes.
def _get_tags_bytes_via_hpss(self):
Undocumented
def _vfs_set_tags_bytes(self, bytes):
Undocumented
def _set_tags_bytes(self, bytes):
Mirror method for _get_tags_bytes.
See AlsoBranch._get_tags_bytes.
def lock_read(self):
Lock the branch for read operations.
ReturnsA bzrlib.lock.LogicalLockResult.
def _remote_lock_write(self, token):
Undocumented
def lock_write(self, token=None):
Lock the branch for write operations.
ParameterstokenA token to permit reacquiring a previously held and preserved lock.
ReturnsA BranchWriteLockResult.
def _unlock(self, branch_token, repo_token):
Undocumented
@only_raises(errors.LockNotHeld, errors.LockBroken)
def unlock(self):
Undocumented
def break_lock(self):
Break a lock if one is present from another instance.

Uses the ui factory to ask for confirmation if the lock may be from an active process.

This will probe the repository for its lock as well.

def leave_lock_in_place(self):
Tell this branch object not to release the physical lock when this object is unlocked.

If lock_write doesn't return a token, then this method is not supported.

def dont_leave_lock_in_place(self):
Tell this branch object to release the physical lock when this object is unlocked, even if it didn't originally acquire it.

If lock_write doesn't return a token, then this method is not supported.

@needs_read_lock
def get_rev_id(self, revno, history=None):
Find the revision id of the specified revno.
def _read_last_revision_info(self):
Undocumented
def _gen_revision_history(self):
See Branch._gen_revision_history().
def _remote_path(self):
Undocumented
def _set_last_revision_descendant(self, revision_id, other_branch, allow_diverged=False, allow_overwrite_descendant=False):
Undocumented
def _set_last_revision(self, revision_id):
Undocumented
@symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4, 0)))
@needs_write_lock
def set_revision_history(self, rev_history):
See Branch.set_revision_history.
@needs_write_lock
def _set_revision_history(self, rev_history):
Undocumented
def _get_parent_location(self):
Undocumented
def _vfs_get_parent_location(self):
Undocumented
def _set_parent_location(self, url):
Undocumented
def _vfs_set_parent_location(self, url):
Undocumented
@needs_write_lock
def pull(self, source, overwrite=False, stop_revision=None, **kwargs):
Mirror source into this branch.

This branch is considered to be 'local', having low latency.

ReturnsPullResult instance
@needs_read_lock
def push(self, target, overwrite=False, stop_revision=None, lossy=False):
Mirror this branch into target.

This branch is considered to be 'local', having low latency.

def is_locked(self):
Undocumented
@needs_read_lock
def revision_id_to_revno(self, revision_id):
Given a revision id, return its revno
@needs_write_lock
def set_last_revision_info(self, revno, revision_id):
Set the last revision of this branch.

The caller is responsible for checking that the revno is correct for this revision id.

It may be possible to set the branch last revision to an id not present in the repository. However, branches can also be configured to check constraints on history, in which case this may not be permitted.

@needs_write_lock
def generate_revision_history(self, revision_id, last_rev=None, other_branch=None):
See Branch.generate_revision_history
def set_push_location(self, location):
Set a new push location for this branch.
def heads_to_fetch(self):
Return the heads that must and that should be fetched to copy this branch into another repo.
Returnsa 2-tuple of (must_fetch, if_present_fetch). must_fetch is a set of heads that must be fetched. if_present_fetch is a set of heads that must be fetched if present, but no error is necessary if they are not present.
def _rpc_heads_to_fetch(self):
Undocumented
def _vfs_heads_to_fetch(self):
Undocumented
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.