b.t.t.InstrumentedDirState(dirstate.DirState) : class documentation

Part of bzrlib.tests.test_dirstate View In Hierarchy

An DirState with instrumented sha1 functionality.
Method __init__ Create a DirState object.
Method adjust_time Move the clock forward or back.
Method _sha_cutoff_time Return cutoff time.
Method _sha1_file_and_log Undocumented
Method _read_link Read the target of a symlink
Method _lstat Return the os.lstat value for this path.
Method _is_executable Is this file executable?

Inherited from DirState:

Method __repr__ Undocumented
Method add Add a path to be tracked.
Static Method from_tree Create a dirstate from a bzr Tree.
Method update_by_delta Apply an inventory delta to the dirstate for tree 0
Method update_basis_by_delta Update the parents of this tree after a commit.
Method get_ghosts Return a list of the parent tree revision ids that are ghosts.
Method get_lines Serialise the entire dirstate to a sequence of lines.
Method get_parent_ids Return a list of the parent tree ids for the directory state.
Class Method initialize Create a new dirstate on path.
Class Method on_file Construct a DirState on the file at path "path".
Method sha1_from_stat Find a sha1 given a stat lookup.
Method save Save any pending changes created during this session.
Method set_path_id Change the id of path to new_id in the current working tree.
Method set_parent_trees Set the parent trees for the dirstate.
Method set_state_from_inventory Set new_inv as the current state.
Method set_state_from_scratch Wipe the currently stored state and set it to something new.
Method update_minimal Update an entry to the state in tree 0.
Method lock_read Acquire a read lock on the dirstate.
Method lock_write Acquire a write lock on the dirstate.
Method unlock Drop any locks held on the dirstate.
Method _mark_modified Mark this dirstate as modified.
Method _mark_unmodified Mark this dirstate as unmodified.
Method _bisect Bisect through the disk structure for specific rows.
Method _bisect_dirblocks Bisect through the disk structure to find entries in given dirs.
Method _bisect_recursive Bisect for entries for all paths and their children.
Method _discard_merge_parents Discard any parents trees beyond the first.
Method _empty_parent_info Undocumented
Method _ensure_block Ensure a block for dirname exists.
Method _entries_to_current_state Load new_entries into self.dirblocks.
Method _split_root_dirblock_into_contents Split the root dirblocks into root and contents-of-root.
Method _entries_for_path Return a list with all the entries that match path for all ids.
Method _entry_to_line Serialize entry to a NULL delimited line ready for _get_output_lines.
Method _fields_per_entry How many null separated fields should be in each entry row.
Method _find_block Return the block that key should be present in.
Method _find_block_index_from_key Find the dirblock index for a key.
Method _find_entry_index Find the entry index for a key in a block.
Method _check_delta_is_valid Undocumented
Method _apply_removals Undocumented
Method _apply_insertions Undocumented
Method _check_delta_ids_absent Check that none of the file_ids in new_ids are present in a tree.
Method _raise_invalid Undocumented
Method _update_basis_apply_adds Apply a sequence of adds to tree 1 during update_basis_by_delta.
Method _update_basis_apply_changes Apply a sequence of changes to tree 1 during update_basis_by_delta.
Method _update_basis_apply_deletes Apply a sequence of deletes to tree 1 during update_basis_by_delta.
Method _after_delta_check_parents Check that parents required by the delta are all intact.
Method _observed_sha1 Note the sha1 of a file.
Method _sha1_file_and_mutter Undocumented
Method _is_executable_win32 On win32 the executable bit is stored in the dirstate.
Method _get_ghosts_line Create a line for the state file for ghost information.
Method _get_parents_line Create a line for the state file for parents information.
Method _get_entry_lines Create lines for entries.
Method _get_fields_to_entry Get a function which converts entry fields into a entry record.
Method _get_block_entry_index Get the coordinates for a path in the state structure.
Method _get_entry Get the dirstate entry for path in tree tree_index.
Static Method _inv_entry_to_details Convert an inventory entry (from a revision tree) to state details.
Method _iter_child_entries Iterate over all the entries that are children of path_utf.
Method _iter_entries Iterate over all the entries in the dirstate.
Method _get_id_index Get an id index of self._dirblocks.
Method _add_to_id_index Add this entry to the _id_index mapping.
Method _remove_from_id_index Remove this entry from the _id_index mapping.
Method _get_output_lines Format lines for final output.
Method _make_deleted_row Return a deleted row for fileid_utf8.
Method _num_present_parents The number of parent entries in each record row.
Method _read_dirblocks_if_needed Read in all the dirblocks from the file if they are not in memory.
Method _read_header This reads in the metadata header, and the parent ids.
Method _read_header_if_needed Read the header of the dirstate file if needed.
Method _read_prelude Read in the prelude header of the dirstate file.
Method _get_packed_stat_index Get a packed_stat index of self._dirblocks.
Method _maybe_fdatasync Flush to disk if possible and if not configured off.
Method _worth_saving Is it worth saving the dirstate or not?
Method _set_data Set the full dirstate data in memory.
Method _sort_entries Given a list of entries, sort them into the right order.
Method _make_absent Mark current_old - an entry - as absent for tree 0.
Method _maybe_remove_row Remove index if it is absent or relocated across the row.
Method _validate Check that invariants on the dirblock are correct.
Method _wipe_state Forget all state information about the dirstate.
Method _requires_lock Check that a lock is currently held by someone on the dirstate.
def __init__(self, path, sha1_provider, worth_saving_limit=0):
Create a DirState object.
ParameterspathThe path at which the dirstate file on disk should live.
sha1_provideran object meeting the SHA1Provider interface.
worth_saving_limitwhen the exact number of hash changed entries is known, only bother saving the dirstate if more than this count of entries have changed. -1 means never save hash changes, 0 means always save hash changes.
def _sha_cutoff_time(self):
Return cutoff time.

Files modified more recently than this time are at risk of being undetectably modified and so can't be cached.

def _sha1_file_and_log(self, abspath):
Undocumented
def _read_link(self, abspath, old_link):
Read the target of a symlink
def _lstat(self, abspath, entry):
Return the os.lstat value for this path.
def _is_executable(self, mode, old_executable):
Is this file executable?
def adjust_time(self, secs):
Move the clock forward or back.

:param secs: The amount to adjust the clock by. Positive values make it
seem as if we are in the future, negative values make it seem like we
are in the past.
API Documentation for Bazaar, generated by pydoctor at 2019-09-15 00:37:39.