b.b.Branch(controldir.ControlComponent) : class documentation

Part of bzrlib.branch View In Hierarchy

Known subclasses: bzrlib.branch.BzrBranch, bzrlib.foreign.ForeignBranch, bzrlib.remote.RemoteBranch, bzrlib.tests.test_bzrdir._TestBranch, bzrlib.tests.test_bzrdir.SampleBranch

Branch holding a history of revisions.
Instance VariablesbaseBase directory/url of the branch; using control_url and control_transport is more standardized.
hooksAn instance of BranchHooks.
_master_branch_cachecached result of get_master_branch, see _clear_cached_state.
Method control_transport Undocumented
Method user_transport Undocumented
Method __init__ Undocumented
Method break_lock Break a lock if one is present from another instance.
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 is_locked Undocumented
Method lock_write Lock the branch for write operations.
Method lock_read Lock the branch for read operations.
Method unlock Undocumented
Method peek_lock_mode Return lock mode for the Branch: 'r', 'w' or None
Method get_physical_lock_status Undocumented
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 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 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 get_stacked_on_url Get the URL this branch is stacked against.
Method print_file Print file to stdout.
Method set_revision_history See Branch.set_revision_history.
Method set_last_revision_info Set the last revision of this branch.
Method generate_revision_history See Branch.generate_revision_history
Method set_parent See Branch.set_parent.
Method set_stacked_on_url Set the URL this branch is stacked against.
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 revision_id_to_revno Given a revision id, return its revno
Method get_rev_id Find the revision id of the specified revno.
Method pull Mirror source into this branch.
Method push Mirror this branch into target.
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 set_push_location Set a new push location for this branch.
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 heads_to_fetch Return the heads that must and that should be fetched to copy this
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_config Get the concrete config for just the config in this branch.
Method _get_fallback_repository Get the repository we fallback to at url.
Method _get_tags_bytes Get the bytes of a serialised tags dict.
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 _set_revision_history Undocumented
Method _unstack Change a branch to be unstacked, copying data as needed.
Method _set_tags_bytes Mirror method for _get_tags_bytes.
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 _clear_cached_state Clear any cached data on this branch, e.g. cached revision history.
Method _gen_revision_history Return sequence of revision hashes on to this branch.
Method _revision_history Undocumented
Method _read_last_revision_info Undocumented
Method _get_parent_location 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 _get_checkout_format Return the most suitable metadir for a checkout of this branch.
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:

Method control_url Undocumented
Method user_url Undocumented
@property
def control_transport(self):
Undocumented
@property
def user_transport(self):
Undocumented
def __init__(self, *ignored, **ignored_too):
Undocumented
def _open_hook(self):
Called by init to allow simpler extension of the base class.
def _activate_fallback_location(self, url):
Activate the branch/repository from url as a fallback repository.
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 _check_stackable_repo(self):
Undocumented
def _extend_partial_history(self, stop_index=None, stop_revision=None):
Extend the partial history to include a given index

If a stop_index is supplied, stop when that index has been reached. If a stop_revision is supplied, stop when that revision is encountered. Otherwise, stop when the beginning of history is reached.

Parametersstop_indexThe index which should be present. When it is present, history extension will stop.
stop_revisionThe revision id which should be present. When it is encountered, history extension will stop.
def _get_check_refs(self):
Get the references needed for check().

See bzrlib.check.

@staticmethod
def open(base, _unsupported=False, possible_transports=None):
Open the branch rooted at base.

For instance, if the branch is at URL/.bzr/branch, Branch.open(URL) -> a Branch instance.

@staticmethod
def open_from_transport(transport, name=None, _unsupported=False):
Open the branch rooted at transport
@staticmethod
def open_containing(url, possible_transports=None):
Open an existing branch which contains url.

This probes for a branch at url, and searches upwards from there.

Basically we keep looking up until we find the control directory or run into the root. If there isn't one, raises NotBranchError. If there is one and it is either an unrecognised format or an unsupported format, UnknownFormatError or UnsupportedFormatError are raised. If there is one, it is returned, along with the unused portion of url.

def _push_should_merge_tags(self):
Should _basic_push merge this branch's tags into the target?

The default implementation returns False if this branch has no tags, and True the rest of the time. Subclasses may override this.

def get_config(self):
Get a bzrlib.config.BranchConfig for this Branch.

This can then be used to get and set configuration options for the branch.

ReturnsA bzrlib.config.BranchConfig.
def get_config_stack(self):
Get a bzrlib.config.BranchStack for this Branch.

This can then be used to get and set configuration options for the branch.

ReturnsA bzrlib.config.BranchStack.
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_fallback_repository(self, url):
Get the repository we fallback to at url.
@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_nick(self, local=False, possible_transports=None):
Undocumented
def _set_nick(self, nick):
Undocumented
def is_locked(self):
Undocumented
def _lefthand_history(self, revision_id, last_rev=None, other_branch=None):
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 lock_read(self):
Lock the branch for read operations.
ReturnsA bzrlib.lock.LogicalLockResult.
def unlock(self):
Undocumented
def peek_lock_mode(self):
Return lock mode for the Branch: 'r', 'w' or None
def get_physical_lock_status(self):
Undocumented
@needs_read_lock
def dotted_revno_to_revision_id(self, revno, _cache_reverse=False):
Return the revision_id for a dotted revno.
Parametersrevnoa tuple like (1,) or (1,1,2)
_cache_reversea private parameter enabling storage of the reverse mapping in a top level cache. (This should only be done in selective circumstances as we want to avoid having the mapping cached multiple times.)
Returnsthe revision_id
Raiseserrors.NoSuchRevisionif the revno doesn't exist
def _do_dotted_revno_to_revision_id(self, revno):
Worker function for dotted_revno_to_revision_id.

Subclasses should override this if they wish to provide a more efficient implementation.

@needs_read_lock
def revision_id_to_dotted_revno(self, revision_id):
Given a revision id, return its dotted revno.
Returnsa tuple like (1,) or (400,1,3).
def _do_revision_id_to_dotted_revno(self, revision_id):
Worker function for revision_id_to_revno.
@needs_read_lock
def get_revision_id_to_revno_map(self):
Return the revision_id => dotted revno map.

This will be regenerated on demand, but will be cached.

ReturnsA dictionary mapping revision_id => dotted revno. This dictionary should not be modified by the caller.
def _gen_revno_map(self):
Create a new mapping from revision ids to dotted revnos.

Dotted revnos are generated based on the current tip in the revision history. This is the worker function for get_revision_id_to_revno_map, which just caches the return value.

ReturnsA dictionary mapping revision_id => dotted revno.
@needs_read_lock
def iter_merge_sorted_revisions(self, start_revision_id=None, stop_revision_id=None, stop_rule='exclude', direction='reverse'):
Walk the revisions for a branch in merge sorted order.

Merge sorted order is the output from a merge-aware, topological sort, i.e. all parents come before their children going forward; the opposite for reverse.

Parametersstart_revision_idthe revision_id to begin walking from. If None, the branch tip is used.
stop_revision_idthe revision_id to terminate the walk after. If None, the rest of history is included.
stop_rule

if stop_revision_id is not None, the precise rule to use for termination:

  • 'exclude' - leave the stop revision out of the result (default)
  • 'include' - the stop revision is the last item in the result
  • 'with-merges' - include the stop revision and all of its merged revisions in the result
  • 'with-merges-without-common-ancestry' - filter out revisions that are in both ancestries
direction

either 'reverse' or 'forward':

  • reverse means return the start_revision_id first, i.e. start at the most recent revision and go backwards in history
  • forward returns tuples in the opposite order to reverse. Note in particular that forward does not do any intelligent ordering w.r.t. depth as some clients of this API may like. (If required, that ought to be done at higher layers.)
Returns

an iterator over (revision_id, depth, revno, end_of_merge) tuples where:

  • revision_id: the unique id of the revision
  • depth: How many levels of merging deep this node has been found.
  • revno_sequence: This field provides a sequence of revision numbers for all revisions. The format is: (REVNO, BRANCHNUM, BRANCHREVNO). BRANCHNUM is the number of the branch that the revno is on. From left to right the REVNO numbers are the sequence numbers within that branch of the revision.
  • end_of_merge: When True the next node (earlier in history) is part of a different merge.
def _filter_merge_sorted_revisions(self, merge_sorted_revisions, start_revision_id, stop_revision_id, stop_rule):
Iterate over an inclusive range of sorted revisions.
def _filter_start_non_ancestors(self, rev_iter):
Undocumented
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.

def bind(self, other):
Bind the local branch the other branch.
ParametersotherThe branch to bind to (type: Branch)
def get_append_revisions_only(self):
Whether it is only possible to append revisions to the history.
def set_append_revisions_only(self, enabled):
Undocumented
def set_reference_info(self, file_id, tree_path, branch_location):
Set the branch location to use for a tree reference.
def get_reference_info(self, file_id):
Get the tree_path and branch_location for a tree reference.
@needs_write_lock
def fetch(self, from_branch, last_revision=None, limit=None):
Copy revisions from from_branch into this branch.
Parametersfrom_branchWhere to copy from.
last_revisionWhat revision to stop at (None for at the end of the branch.
limitOptional rough limit of revisions to fetch
ReturnsNone
def get_bound_location(self):
Return the URL of the branch we are bound to.

Older format branches cannot bind, please be sure to use a metadir branch.

def get_old_bound_location(self):
Return the URL of the branch we used to be bound to
def get_commit_builder(self, parents, config=None, timestamp=None, timezone=None, committer=None, revprops=None, revision_id=None, lossy=False):
Obtain a CommitBuilder for this branch.
ParametersparentsRevision ids of the parents of the new revision.
configOptional configuration to use.
timestampOptional timestamp recorded for commit.
timezoneOptional timezone for timestamp.
committerOptional committer to set for commit.
revpropsOptional dictionary of revision properties.
revision_idOptional revision id.
lossyWhether to discard data that can not be natively represented, when pushing to a foreign VCS
def get_master_branch(self, possible_transports=None):
Return the branch we are bound to.
ReturnsEither a Branch, or None
@deprecated_method(deprecated_in((2, 5, 0)))
def get_revision_delta(self, revno):
Return the delta for one revision.

The delta is relative to its mainline predecessor, or the empty tree for revision 1.

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.
def print_file(self, file, revision_id):
Print file to stdout.
@deprecated_method(deprecated_in((2, 4, 0)))
def set_revision_history(self, rev_history):
See Branch.set_revision_history.
@needs_write_lock
def _set_revision_history(self, rev_history):
Undocumented
@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
@needs_write_lock
def set_parent(self, url):
See Branch.set_parent.
@needs_write_lock
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 _unstack(self):
Change a branch to be unstacked, copying data as needed.

Don't call this directly, use set_stacked_on_url(None).

def _set_tags_bytes(self, bytes):
Mirror method for _get_tags_bytes.
See AlsoBranch._get_tags_bytes.
def _set_tags_bytes_locked(self, bytes):
Undocumented
def _cache_revision_history(self, rev_history):
Set the cached revision history to rev_history.

The revision_history method will use this cache to avoid regenerating the revision history.

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

def _cache_revision_id_to_revno(self, revision_id_to_revno):
Set the cached revision_id => revno map to revision_id_to_revno.

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

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 _gen_revision_history(self):
Return sequence of revision hashes on to this branch.

Unlike revision_history, this method always regenerates or rereads the revision history, i.e. it does not cache the result, so repeated calls may be expensive.

Concrete subclasses should override this instead of revision_history so that subclasses do not need to deal with caching logic.

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

@deprecated_method(deprecated_in((2, 5, 0)))
@needs_read_lock
def revision_history(self):
Return sequence of revision ids on this branch.

This method will cache the revision history for as long as it is safe to do so.

def _revision_history(self):
Undocumented
def revno(self):
Return current revision number for this branch.

That is equivalent to the number of revisions committed to this branch.

def unbind(self):
Older format branches cannot bind or unbind.
def last_revision(self):
Return last revision id, or NULL_REVISION.
@needs_read_lock
def last_revision_info(self):
Return information about the last revision.
ReturnsA tuple (revno, revision_id).
def _read_last_revision_info(self):
Undocumented
@deprecated_method(deprecated_in((2, 4, 0)))
def import_last_revision_info(self, source_repo, revno, revid):
Set the last revision info, importing from another repo if necessary.
Parameterssource_repoSource repository to optionally fetch from
revnoRevision number of the new tip
revidRevision id of the new tip
def import_last_revision_info_and_tags(self, source, revno, revid, lossy=False):
Set the last revision info, importing from another repo if necessary.

This is used by the bound branch code to upload a revision to the master branch first before updating the tip of the local branch. Revisions referenced by source's tags are also transferred.

ParameterssourceSource branch to optionally fetch from
revnoRevision number of the new tip
revidRevision id of the new tip
lossyWhether to discard metadata that can not be natively represented
ReturnsTuple with the new revision number and revision id (should only be different from the arguments when lossy=True)
def revision_id_to_revno(self, revision_id):
Given a revision id, return its revno
@needs_read_lock
def get_rev_id(self, revno, history=None):
Find the revision id of the specified revno.
def pull(self, source, *args, overwrite=False, stop_revision=None, possible_transports=None, **kwargs):
Mirror source into this branch.

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

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

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

def basis_tree(self):
Return Tree object for last revision.
def get_parent(self):
Return the parent location of the branch.

This is the default location for pull/missing. The usual pattern is that the user can override it by specifying a location.

def _get_parent_location(self):
Undocumented
def _set_config_location(self, name, url, config=None, make_relative=False):
Undocumented
def _get_config_location(self, name, config=None):
Undocumented
def get_child_submit_format(self):
Return the preferred format of submissions to this branch.
def get_submit_branch(self):
Return the submit location of the branch.

This is the default location for bundle. The usual pattern is that the user can override it by specifying a location.

def set_submit_branch(self, location):
Return the submit location of the branch.

This is the default location for bundle. The usual pattern is that the user can override it by specifying a location.

def get_public_branch(self):
Return the public location of the branch.

This is used by merge directives.

def set_public_branch(self, location):
Return the submit location of the branch.

This is the default location for bundle. The usual pattern is that the user can override it by specifying a location.

def get_push_location(self):
Return the None or the location to push this branch to.
def set_push_location(self, location):
Set a new push location for this branch.
def _run_post_change_branch_tip_hooks(self, old_revno, old_revid):
Run the post_change_branch_tip hooks.
def _run_pre_change_branch_tip_hooks(self, new_revno, new_revid):
Run the pre_change_branch_tip hooks.
@needs_write_lock
def update(self):
Synchronise this branch with the master branch if any.
ReturnsNone or the last_revision pivoted out during the update.
def check_revno(self, revno):
Check whether a revno corresponds to any revision. Zero (the NULL revision) is considered valid.
def check_real_revno(self, revno):
Check whether a revno corresponds to a real revision. Zero (the NULL revision) is considered invalid
@needs_read_lock
def clone(self, to_bzrdir, revision_id=None, repository_policy=None):

Clone this branch into to_bzrdir preserving all semantic values.

Most API users will want 'create_clone_on_transport', which creates a new bzrdir and branch on the fly.

revision_id: if not None, the revision history in the new branch will
be truncated to end with revision_id.
@needs_read_lock
def sprout(self, to_bzrdir, revision_id=None, repository_policy=None, repository=None):

Create a new line of development from the branch, into to_bzrdir.

to_bzrdir controls the branch format.

revision_id: if not None, the revision history in the new branch will
be truncated to end with revision_id.
def _synchronize_history(self, destination, revision_id):
Synchronize last revision and revision history between branches.

This version is most efficient when the destination is also a BzrBranch6, but works for BzrBranch5, as long as the destination's repository contains all the lefthand ancestors of the intended last_revision. If not, set_last_revision_info will fail.

ParametersdestinationThe branch to copy the history into
revision_idThe revision-id to truncate history at. May be None to copy complete history.
def copy_content_into(self, destination, revision_id=None):

Copy the content of self into destination.

revision_id: if not None, the revision history in the new branch will
be truncated to end with revision_id.
def update_references(self, target):
Undocumented
@needs_read_lock
def check(self, refs):
Check consistency of the branch.

In particular this checks that revisions given in the revision-history do actually match up in the revision graph, and that they're all present in the repository.

Callers will typically also want to check the repository.

ParametersrefsCalculated refs for this branch as specified by branch._get_check_refs()
ReturnsA BranchCheckResult.
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 create_clone_on_transport(self, to_transport, revision_id=None, stacked_on=None, create_prefix=False, use_existing_dir=False, no_tree=None):
Create a clone of this branch and its bzrdir.
Parametersto_transportThe transport to clone onto.
revision_idThe revision id to use as tip in the new branch. If None the tip is obtained from this branch.
stacked_onAn optional URL to stack the clone on.
create_prefixCreate any missing directories leading up to to_transport.
use_existing_dirUse an existing directory if one exists.
def create_checkout(self, to_location, revision_id=None, lightweight=False, accelerator_tree=None, hardlink=False):
Create a checkout of a branch.
Parametersto_locationThe url to produce the checkout at
revision_idThe revision to check out
lightweightIf True, produce a lightweight checkout, otherwise, produce a bound branch (heavyweight checkout)
accelerator_treeA tree which can be used for retrieving file contents more quickly than the revision tree, i.e. a workingtree. The revision tree will be used for cases where accelerator_tree's content is different.
hardlinkIf true, hard-link files from accelerator_tree, where possible.
ReturnsThe tree of the created checkout
@needs_write_lock
def reconcile(self, thorough=True):
Make sure the data stored in this branch is consistent.
def reference_parent(self, file_id, path, possible_transports=None):
Return the parent branch for a tree-reference file_id
Parametersfile_idThe file_id of the tree reference
pathThe path of the file_id in the tree
ReturnsA branch associated with the file_id
def supports_tags(self):
Undocumented
def automatic_tag_name(self, revision_id):
Try to automatically find the tag name for a revision.
Parametersrevision_idRevision id of the revision.
ReturnsA tag name or None if no tag name could be determined.
def _check_if_descendant_or_diverged(self, revision_a, revision_b, graph, other_branch):
Ensure that revision_b is a descendant of revision_a.

This is a helper function for update_revisions.

ReturnsTrue if revision_b is a descendant of revision_a.
RaisesDivergedBranches if revision_b has diverged from revision_a.
def _revision_relations(self, revision_a, revision_b, graph):
Determine the relationship between two revisions.
ReturnsOne of: 'a_descends_from_b', 'b_descends_from_a', 'diverged'
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.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.