b.i.CHKInventoryDirectory(InventoryDirectory) : class documentation

Part of bzrlib.inventory View In Hierarchy

A directory in an inventory.
Method __init__ Create an InventoryEntry
Method children Access the list of children of this directory.

Inherited from InventoryDirectory:

Method copy Clone this inventory entry.
Method kind_character See InventoryEntry.kind_character.
Method _check See InventoryEntry._check

Inherited from InventoryEntry (via InventoryDirectory):

Method detect_changes Return a (text_modified, meta_modified) from this to old_entry.
Method parent_candidates Find possible per-file graph parents.
Method has_text Return true if the object this entry represents has textual data.
Method sorted_children Undocumented
Static Method versionable_kind Undocumented
Method check Check this inventory entry is intact.
Static Method describe_change Describe the change between old_entry and this.
Method __repr__ Undocumented
Method __eq__ Undocumented
Method __ne__ Undocumented
Method __hash__ Undocumented
Method _diff Perform a diff between two entries of the same kind.
Method _unchanged Has this entry changed relative to previous_ie.
Method _read_tree_state Populate fields in the inventory entry from the given tree.
Method _forget_tree_state Undocumented
def __init__(self, file_id, name, parent_id, chk_inventory):

Create an InventoryEntry

The filename must be a single component, relative to the parent directory; it cannot be a whole path or relative name.

>>> e = InventoryFile('123', 'hello.c', ROOT_ID)
>>> e.name
'hello.c'
>>> e.file_id
'123'
>>> e = InventoryFile('123', 'src/hello.c', ROOT_ID)
Traceback (most recent call last):
InvalidEntryName: Invalid entry name: src/hello.c
@property
def children(self):
Access the list of children of this directory.

With a parent_id_basename_to_file_id index, loads all the children, without loads the entire index. Without is bad. A more sophisticated proxy object might be nice, to allow partial loading of children as well when specific names are accessed. (So path traversal can be written in the obvious way but not examine siblings.).

API Documentation for Bazaar, generated by pydoctor at 2022-06-16 00:25:16.