Part of bzrlib.repository View In Hierarchy
Known subclasses: bzrlib.vf_repository.VersionedFileCommitBuilder
This allows describing a tree to be committed without needing to know the internals of the format of the repository.
Method | __init__ | Initiate a CommitBuilder. |
Method | any_changes | Return True if any entries were changed. |
Method | commit | Make the actual commit. |
Method | abort | Abort the commit that is being built. |
Method | revision_tree | Return the tree that was just committed. |
Method | finish_inventory | Tell the builder that the inventory is finished. |
Method | will_record_deletes | Tell the commit builder that deletes are being notified. |
Method | record_iter_changes | Record a new tree via iter_changes. |
Method | _validate_unicode_text | Verify things like commit messages don't have bogus characters. |
Method | _validate_revprops | Undocumented |
Method | _gen_revision_id | Return new revision-id. |
Method | _generate_revision_if_needed | Create a revision id if None was supplied. |
Parameters | repository | Repository to commit to. |
parents | Revision ids of the parents of the new revision. | |
timestamp | Optional timestamp recorded for commit. | |
timezone | Optional timezone for timestamp. | |
committer | Optional committer to set for commit. | |
revprops | Optional dictionary of revision properties. | |
revision_id | Optional revision id. | |
lossy | Whether to discard data that can not be natively represented, when pushing to a foreign VCS |
This includes merge-only changes. It is the core for the --unchanged detection in commit.
Returns | True if any changes have occured. |
Returns | The revision id of the recorded revision. |
After calling commit() this can be called to get a RevisionTree representing the newly committed tree. This is preferred to calling Repository.revision_tree() because that may require deserializing the inventory, while we already have a copy in memory.
Returns | The inventory id in the repository, which can be used with repository.get_inventory. |
If the repository can not support user-specified revision ids they should override this function and raise CannotSetRevisionId if _new_revision_id is not None.
Raises | CannotSetRevisionId |
This enables the accumulation of an inventory delta; for the resulting commit to be valid, deletes against the basis MUST be recorded via builder.record_delete().
Parameters | tree | The tree to obtain text contents from for changed objects. |
basis_revision_id | The revision id of the tree the iter_changes has been generated against. Currently assumed to be the same as self.parents[0] - if it is not, errors may occur. | |
iter_changes | An iter_changes iterator with the changes to apply to basis_revision_id. The iterator must not include any items with a current kind of None - missing items must be either filtered out or errored-on beefore record_iter_changes sees the item. | |
Returns | A generator of (file_id, relpath, fs_hash) tuples for use with tree._observed_sha1. |