Part of bzrlib.vf_repository View In Hierarchy
Known subclasses: bzrlib.repofmt.pack_repo.PackCommitBuilder, bzrlib.vf_repository.VersionedFileRootCommitBuilder
Method | __init__ | Initiate a CommitBuilder. |
Method | will_record_deletes | Tell the commit builder that deletes are being notified. |
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 | get_basis_delta | Return the complete inventory delta versus the basis inventory. |
Method | record_delete | Record that a delete occured against a basis tree. |
Method | record_entry_contents | Record the content of ie from tree into the commit if needed. |
Method | record_iter_changes | Record a new tree via iter_changes. |
Method | _ensure_fallback_inventories | Ensure that appropriate inventories are available. |
Method | _check_root | Helper for record_entry_contents. |
Method | _require_root_change | Enforce an appropriate root object change. |
Method | _get_delta | Get a delta against the basis inventory for ie. |
Method | _heads | Calculate the graph heads for revision_ids in the graph of file_id. |
Method | _add_text_to_weave | Undocumented |
Inherited from CommitBuilder:
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 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().
This includes merge-only changes. It is the core for the --unchanged detection in commit.
Returns | True if any changes have occured. |
This only applies to repositories that are stacked, and is about enusring the stacking invariants. Namely, that for any revision that is present, we either have all of the file content, or we have the parent inventory and the delta file content.
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. |
Parameters | ie | An entry being added. |
parent_invs | The inventories of the parent revisions of the commit. | |
tree | The tree that is being committed. |
This is called once when record_iter_changes is called, if and only if the root was not in the delta calculated by record_iter_changes.
Parameters | tree | The tree which is being committed. |
This can use either a per-file graph or a global revision graph as we have an identity relationship between the two graphs.
This has been built up with the calls to record_delete and record_entry_contents. The client must have already called will_record_deletes() to indicate that they will be generating a complete delta.
Returns | An inventory delta, suitable for use with apply_delta, or Repository.add_inventory_by_delta, etc. |
This is an optional API - when used it adds items to the basis_delta being accumulated by the commit builder. It cannot be called unless the method will_record_deletes() has been called to inform the builder that a delta is being supplied.
Parameters | path | The path of the thing deleted. |
file_id | The file id that was deleted. |
Side effect: sets ie.revision when unchanged
Parameters | ie | An inventory entry present in the commit. |
parent_invs | The inventories of the parent revisions of the commit. | |
path | The path the entry is at in the tree. | |
tree | The tree which contains this entry and should be used to obtain content. | |
content_summary | Summary data from the tree about the paths content - stat, length, exec, sha/link target. This is only accessed when the entry has a revision of None - that is when it is a candidate to commit. | |
Returns | A tuple (change_delta, version_recorded, fs_hash). change_delta is an inventory_delta change for this entry against the basis tree of the commit, or None if no change occured against the basis tree. version_recorded is True if a new version of the entry has been recorded. For instance, committing a merge where a file was only changed on the other side will return (delta, False). fs_hash is either None, or the hash details for the path (currently a tuple of the contents sha1 and the statvalue returned by tree.get_file_with_stat()). |
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 before record_iter_changes sees the item. | |
_entry_factory | Private method to bind entry_factory locally for performance. | |
Returns | A generator of (file_id, relpath, fs_hash) tuples for use with tree._observed_sha1. |