b.s.ShelfCreator(object) : class documentation

Part of bzrlib.shelf View In Hierarchy

Create a transform to shelve objects and its inverse.
Method __init__ Constructor.
Method iter_shelvable Iterable of tuples describing shelvable changes.
Method shelve_change Shelve a change in the iter_shelvable format.
Method shelve_all Shelve all changes.
Method shelve_rename Shelve a file rename.
Method shelve_modify_target Shelve a change of symlink target.
Method shelve_lines Shelve text changes to a file, using provided lines.
Method shelve_content_change Shelve a kind change or binary file content change.
Method shelve_creation Shelve creation of a file.
Method shelve_deletion Shelve deletion of a file.
Method finalize Release all resources used by this ShelfCreator.
Method transform Shelve changes from working tree.
Method write_shelf Serialize the shelved changes to a file.
Static Method _content_from_tree Undocumented
Method _shelve_creation Undocumented
Method _inverse_lines Produce a version with only those changes removed from new_lines.
def __init__(self, work_tree, target_tree, file_list=None):
Constructor.
Parameterswork_treeThe working tree to apply changes to. This is not required to be locked - a tree_write lock will be taken out.
target_treeThe tree to make the working tree more similar to. This is not required to be locked - a read_lock will be taken out.
file_listThe files to make more similar to the target.
def iter_shelvable(self):

Iterable of tuples describing shelvable changes.

As well as generating the tuples, this updates several members. Tuples may be:

('add file', file_id, work_kind, work_path)
('delete file', file_id, target_kind, target_path)
('rename', file_id, target_path, work_path)
('change kind', file_id, target_kind, work_kind, target_path)
('modify text', file_id)
('modify target', file_id, target_target, work_target)
def shelve_change(self, change):
Shelve a change in the iter_shelvable format.
def shelve_all(self):
Shelve all changes.
def shelve_rename(self, file_id):
Shelve a file rename.
Parametersfile_idThe file id of the file to shelve the renaming of.
def shelve_modify_target(self, file_id):
Shelve a change of symlink target.
Parametersfile_idThe file id of the symlink which changed target.
new_targetThe target that the symlink should have due to shelving.
def shelve_lines(self, file_id, new_lines):
Shelve text changes to a file, using provided lines.
Parametersfile_idThe file id of the file to shelve the text of.
new_linesThe lines that the file should have due to shelving.
@staticmethod
def _content_from_tree(tt, tree, file_id):
Undocumented
def shelve_content_change(self, file_id):
Shelve a kind change or binary file content change.
Parametersfile_idThe file id of the file to shelve the content change of.
def shelve_creation(self, file_id):
Shelve creation of a file.

This handles content and inventory id. :param file_id: The file_id of the file to shelve creation of.

def shelve_deletion(self, file_id):
Shelve deletion of a file.

This handles content and inventory id. :param file_id: The file_id of the file to shelve deletion of.

def _shelve_creation(self, tree, file_id, from_transform, to_transform, kind, name, parent, version, existing_path=None):
Undocumented
def _inverse_lines(self, new_lines, file_id):
Produce a version with only those changes removed from new_lines.
def finalize(self):
Release all resources used by this ShelfCreator.
def transform(self):
Shelve changes from working tree.
def write_shelf(self, shelf_file, message=None):
Serialize the shelved changes to a file.
Parametersshelf_fileA file-like object to write the shelf to.
messageAn optional message describing the shelved changes.
Returnsthe filename of the written file.
API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.