b.m.BaseMergeDirective(object) : class documentation

Part of bzrlib.merge_directive View In Hierarchy

Known subclasses: bzrlib.merge_directive.MergeDirective, bzrlib.merge_directive.MergeDirective2

A request to perform a merge into a branch.

This is the base class that all merge directive implementations should derive from.

Class Variablesmultiple_output_filesWhether or not this merge directive stores a set of revisions in more than one file
Method __init__ Constructor.
Method to_lines Serialize as a list of lines
Method to_files Serialize as a set of files.
Method get_raw_bundle Return the bundle for this merge directive.
Method write_to_directory Write this merge directive to a series of files in a directory.
Class Method from_objects Generate a merge directive from various objects
Method get_disk_name Generate a suitable basename for storing this directive on disk
Method to_signed Serialize as a signed string.
Method to_email Serialize as an email message.
Method install_revisions Install revisions and return the target revision
Method compose_merge_request Compose a request to merge this directive.
Method _to_lines Serialize as a list of lines
Static Method _generate_diff Undocumented
Static Method _generate_bundle Undocumented
def __init__(self, revision_id, testament_sha1, time, timezone, target_branch, patch=None, source_branch=None, message=None, bundle=None):
Constructor.
Parametersrevision_idThe revision to merge
testament_sha1The sha1 of the testament of the revision to merge.
timeThe current POSIX timestamp time
timezoneThe timezone offset
target_branchThe branch to apply the merge to
patchThe text of a diff or bundle
source_branchA public location to merge the revision from
messageThe message to use when committing this merge
def to_lines(self):
Serialize as a list of lines
Returnsa list of lines
def to_files(self):
Serialize as a set of files.
ReturnsList of tuples with filename and contents as lines
def get_raw_bundle(self):
Return the bundle for this merge directive.
Returnsbundle text or None if there is no bundle
def _to_lines(self, base_revision=False):
Serialize as a list of lines
Returnsa list of lines
def write_to_directory(self, path):
Write this merge directive to a series of files in a directory.
ParameterspathFilesystem path to write to
@classmethod
def from_objects(klass, repository, revision_id, time, timezone, target_branch, patch_type='bundle', local_target_branch=None, public_branch=None, message=None):
Generate a merge directive from various objects

The public branch is always used if supplied. If the patch_type is not 'bundle', the public branch must be supplied, and will be verified.

If the message is not supplied, the message from revision_id will be used for the commit.

ParametersrepositoryThe repository containing the revision
revision_idThe revision to merge
timeThe POSIX timestamp of the date the request was issued.
timezoneThe timezone of the request
target_branchThe url of the branch to merge into
patch_type'bundle', 'diff' or None, depending on the type of patch desired.
local_target_brancha local copy of the target branch
public_branchlocation of a public branch containing the target revision.
messageMessage to use when committing the merge
ReturnsThe merge directive
def get_disk_name(self, branch):
Generate a suitable basename for storing this directive on disk
ParametersbranchThe Branch this merge directive was generated fro
ReturnsA string
@staticmethod
def _generate_diff(repository, revision_id, ancestor_id):
Undocumented
@staticmethod
def _generate_bundle(repository, revision_id, ancestor_id):
Undocumented
def to_signed(self, branch):
Serialize as a signed string.
ParametersbranchThe source branch, to get the signing strategy
Returnsa string
def to_email(self, mail_to, branch, sign=False):
Serialize as an email message.
Parametersmail_toThe address to mail the message to
branchThe source branch, to get the signing strategy and source email address
signIf True, gpg-sign the email
Returnsan email message
def install_revisions(self, target_repo):
Install revisions and return the target revision
def compose_merge_request(self, mail_client, to, body, branch, tree=None):
Compose a request to merge this directive.
Parametersmail_clientThe mail client to use for composing this request.
toThe address to compose the request to.
branchThe Branch that was used to produce this directive.
treeThe Tree (if any) for the Branch used to produce this directive.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.