b.c.Commit(object) : class documentation

Part of bzrlib.commit View In Hierarchy

Task of committing a new revision.

This is a MethodObject: it accumulates state as the commit is prepared, and then it is discarded. It doesn't represent historical revisions, just the act of recording a new one.

missing_ids Modified to hold a list of files that have been deleted from the working directory; these should be removed from the working inventory.
Method __init__ Create a Commit object.
Static Method update_revprops Undocumented
Method commit Commit working copy as a new revision.
Method _commit Undocumented
Method _select_reporter Select the CommitReporter to use.
Method _check_pointless Undocumented
Method _check_bound_branch Check to see if the local branch is bound.
Method _check_out_of_date_tree Check that the working tree is up to date.
Method _process_pre_hooks Process any registered pre commit hooks.
Method _process_post_hooks Process any registered post commit hooks.
Method _process_hooks Undocumented
Method _gather_parents Record the parents of a merge for merge detection.
Method _update_builder_with_changes Update the commit builder with the data about what has changed.
Method _filter_iter_changes Process iter_changes.
Method _record_unselected Undocumented
Method _report_and_accumulate_deletes Undocumented
Method _check_strict Undocumented
Method _populate_from_inventory Populate the CommitBuilder by walking the working tree inventory.
Method _commit_nested_tree Commit a nested tree.
Method _record_entry Record the new inventory entry for a path if any.
Method _report_change Report a change to the user.
Method _set_progress_stage Set the progress stage and emit an update to the progress bar.
Method _next_progress_entry Emit an update to the progress bar and increment the entry count.
Method _emit_progress Undocumented
Method _set_specific_file_ids populate self.specific_file_ids if we will use it.
def __init__(self, reporter=None, config=None):
Create a Commit object.
Parametersreporterthe default reporter to use or None to decide later
@staticmethod
def update_revprops(revprops, branch, authors=None, author=None, local=False, possible_master_transports=None):
Undocumented
def commit(self, message=None, timestamp=None, timezone=None, committer=None, specific_files=None, rev_id=None, allow_pointless=True, strict=False, verbose=False, revprops=None, working_tree=None, local=False, reporter=None, config=None, message_callback=None, recursive='down', exclude=None, possible_master_transports=None, lossy=False):
Commit working copy as a new revision.
Parametersmessagethe commit message (it or message_callback is required)
message_callbackA callback: message = message_callback(cmt_obj)
timestampif not None, seconds-since-epoch for a postdated/predated commit.
specific_filesIf not None, commit only those files. An empty list means 'commit no files'.
rev_idIf set, use this as the new revision id. Useful for test or import commands that need to tightly control what revisions are assigned. If you duplicate a revision id that exists elsewhere it is your own fault. If null (default), a time/random revision id is generated.
allow_pointlessIf true (default), commit even if nothing has changed and no merges are recorded.
strictIf true, don't allow a commit if the working tree contains unknown files.
revpropsProperties for new revision
localPerform a local only commit.
reporterthe reporter to use or None for the default
verboseif True and the reporter is not None, report everything
recursiveIf set to 'down', commit in any subtrees that have pending changes of any sort during this commit.
excludeNone or a list of relative paths to exclude from the commit. Pending changes to excluded files will be ignored by the commit.
lossyWhen committing to a foreign VCS, ignore any data that can not be natively represented.
def _commit(self, operation, message, timestamp, timezone, committer, specific_files, rev_id, allow_pointless, strict, verbose, working_tree, local, reporter, message_callback, recursive, exclude, possible_master_transports, lossy):
Undocumented
def _select_reporter(self):
Select the CommitReporter to use.
def _check_pointless(self):
Undocumented
def _check_bound_branch(self, operation, possible_master_transports=None):
Check to see if the local branch is bound.

If it is bound, then most of the commit will actually be done using the remote branch as the target branch. Only at the end will the local branch be updated.

def _check_out_of_date_tree(self):
Check that the working tree is up to date.
Returnsold_revision_number,new_revision_number tuple
def _process_pre_hooks(self, old_revno, new_revno):
Process any registered pre commit hooks.
def _process_post_hooks(self, old_revno, new_revno):
Process any registered post commit hooks.
def _process_hooks(self, hook_name, old_revno, new_revno):
Undocumented
def _gather_parents(self):
Record the parents of a merge for merge detection.
def _update_builder_with_changes(self):
Update the commit builder with the data about what has changed.
def _filter_iter_changes(self, iter_changes):
Process iter_changes.

This method reports on the changes in iter_changes to the user, and converts 'missing' entries in the iter_changes iterator to 'deleted' entries. 'missing' entries have their

Parametersiter_changesAn iter_changes to process.
ReturnsA generator of changes.
def _record_unselected(self):
Undocumented
def _report_and_accumulate_deletes(self):
Undocumented
def _check_strict(self):
Undocumented
def _populate_from_inventory(self):
Populate the CommitBuilder by walking the working tree inventory.
def _commit_nested_tree(self, file_id, path):
Commit a nested tree.
def _record_entry(self, path, file_id, specific_files, kind, name, parent_id, definitely_changed, existing_ie, report_changes, content_summary):
Record the new inventory entry for a path if any.
def _report_change(self, ie, path):
Report a change to the user.

The change that has occurred is described relative to the basis inventory.

def _set_progress_stage(self, name, counter=False):
Set the progress stage and emit an update to the progress bar.
def _next_progress_entry(self):
Emit an update to the progress bar and increment the entry count.
def _emit_progress(self):
Undocumented
def _set_specific_file_ids(self):
populate self.specific_file_ids if we will use it.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.