Part of bzrlib.workingtree View In Hierarchy
Known subclasses: bzrlib.workingtree_3.PreDirStateWorkingTree, bzrlib.workingtree_4.DirStateWorkingTree
The inventory is held in the Branch
working-inventory, and the
files are in a directory on disk.
It is possible for a WorkingTree
to have a filename which is
not listed in the Inventory and vice versa.
Method | __init__ | Construct a InventoryWorkingTree instance. This is not a public API. |
Method | set_inventory | Undocumented |
Method | all_file_ids | See Tree.iter_all_file_ids |
Method | set_parent_trees | See MutableTree.set_parent_trees. |
Method | set_conflicts | Undocumented |
Method | add_conflicts | Undocumented |
Method | conflicts | Undocumented |
Method | read_basis_inventory | Read the cached basis inventory. |
Method | read_working_inventory | Read the working inventory. |
Method | get_root_id | Return the id of this trees root |
Method | has_id | Undocumented |
Method | has_or_had_id | Undocumented |
Method | __iter__ | Iterate through file_ids for this tree. |
Method | set_last_revision | Change the last revision in the working tree. |
Method | check_state | Check that the working state is/isn't valid. |
Method | reset_state | Reset the state of the working tree. |
Method | flush | Write the in memory inventory to disk. |
Method | get_file_mtime | See Tree.get_file_mtime. |
Method | is_executable 0 | Undocumented |
Method | is_executable | Undocumented |
Method | revision_tree | See WorkingTree.revision_id. |
Method | annotate_iter | See Tree.annotate_iter |
Method | merge_modified | Return a dictionary of files modified by a merge. |
Method | subsume | Undocumented |
Method | extract | Extract a subtree from this tree. |
Method | list_files | List all files as (path, class, kind, id, entry). |
Method | move | Rename files. |
Method | rename_one | Rename one file. |
Method | unversion | Remove the file ids in file_ids from the current versioned set. |
Method | stored_kind | See Tree.stored_kind |
Method | extras | Yield all unversioned files in this WorkingTree. |
Method | _set_inventory | Set the internal cached inventory. |
Method | _detect_case_handling | Undocumented |
Method | _serialize | Undocumented |
Method | _deserialize | Undocumented |
Method | _write_inventory | Write inventory as the current inventory. |
Method | _write_basis_inventory | Write the basis inventory XML to the basis-inventory file |
Method | _reset_data | Reset transient data that cannot be revalidated. |
Method | _set_root_id | Set the root id for this tree, in a format specific manner. |
Method | _cache_basis_inventory | Cache new_revision as the basis inventory. |
Method | _basis_inventory_name | Undocumented |
Method | _create_basis_xml_from_inventory | Create the text that will be saved in basis-inventory |
Method | _get_check_refs | Return the references needed to perform a check of this tree. |
Method | _check | Check the tree for consistency. |
Method | _is_executable_from_path_and_stat_from_basis | Undocumented |
Method | _is_executable_from_path_and_stat_from_stat | Undocumented |
Method | _add | See MutableTree._add. |
Class | _RenameEntry | Undocumented |
Method | _determine_mv_mode | Determines for each from-to pair if both inventory and working tree |
Method | _move | Moves a list of files. |
Method | _rollback_move | Try to rollback a previous move in case of an filesystem error. |
Method | _move_entry | Undocumented |
Method | _walkdirs | Walk the directories of this tree. |
Inherited from WorkingTree:
Method | user_transport | Undocumented |
Method | control_transport | Undocumented |
Method | is_control_filename | True if filename is the name of a control file in this tree. |
Method | has_versioned_directories | See Tree.has_versioned_directories . |
Method | break_lock | Break a lock if one is present from another instance. |
Method | requires_rich_root | Undocumented |
Method | supports_tree_reference | Undocumented |
Method | supports_content_filtering | Undocumented |
Method | supports_views | Undocumented |
Static Method | open | Open an existing working tree at path. |
Static Method | open_containing | Open an existing working tree which has its root about path. |
Static Method | open_containing_paths | Open the WorkingTree that contains a set of paths. |
Method | safe_relpath_files | Convert file_list into a list of relpaths in tree. |
Static Method | open_downlevel | Open an unsupported working tree. |
Static Method | find_trees | Undocumented |
Method | __repr__ | Undocumented |
Method | abspath | Undocumented |
Method | basis_tree | Return RevisionTree for the current last revision. |
Method | relpath | Return the local path portion from a given path. |
Method | has_filename | Undocumented |
Method | get_file | Undocumented |
Method | get_file_with_stat | See Tree.get_file_with_stat. |
Method | get_file_text | Undocumented |
Method | get_file_byname | Undocumented |
Method | get_file_lines | See Tree.get_file_lines() |
Method | get_parent_ids | See Tree.get_parent_ids. |
Method | clone | Duplicate this working tree into to_bzr, including all state. |
Method | copy_content_into | Copy the current content and user files of this tree into tree. |
Method | id2abspath | Undocumented |
Method | iter_entries_by_dir | See Tree.iter_entries_by_dir() |
Method | get_file_size | See Tree.get_file_size |
Method | add_parent_tree_id | Add revision_id as a parent. |
Method | add_parent_tree | Add revision_id, tree tuple as a parent. |
Method | add_pending_merge | Undocumented |
Method | path_content_summary | See Tree.path_content_summary. |
Method | set_parent_ids | Set the parent ids to revision_ids. |
Method | set_pending_merges | Undocumented |
Method | set_merge_modified | Undocumented |
Method | merge_from_branch | Merge from a branch into this working tree. |
Method | mkdir | See MutableTree.mkdir(). |
Method | get_symlink_target | Undocumented |
Method | unknowns | Return all unknown files. |
Method | pull | Undocumented |
Method | put_file_bytes_non_atomic | See MutableTree.put_file_bytes_non_atomic. |
Method | ignored_files | Yield list of PATH, IGNORE_PATTERN |
Method | get_ignore_list | Return list of ignore patterns. |
Method | is_ignored | Check whether the filename matches an ignore pattern. |
Method | kind | Undocumented |
Method | last_revision | Return the last revision of the branch for this tree. |
Method | is_locked | Undocumented |
Method | lock_read | Lock the tree for reading. |
Method | lock_tree_write | See MutableTree.lock_tree_write, and WorkingTree.unlock. |
Method | lock_write | See MutableTree.lock_write, and WorkingTree.unlock. |
Method | get_physical_lock_status | Undocumented |
Method | remove | Remove nominated files from the working tree metadata. |
Method | revert | Undocumented |
Method | set_root_id | Set the root id for this tree. |
Method | unlock | See Branch.unlock. |
Method | update | Update a working tree along its branch. |
Method | walkdirs | Walk the directories of this tree. |
Method | auto_resolve | Automatically resolve text conflicts according to contents. |
Method | get_shelf_manager | Return the ShelfManager for this WorkingTree. |
Method | _make_views | Undocumented |
Method | _cleanup | Undocumented |
Method | _check_for_tree_references | See if directories have become tree-references. |
Method | _gather_kinds | See MutableTree._gather_kinds. |
Method | _file_content_summary | Undocumented |
Method | _check_parents_for_ghosts | Common ghost checking functionality from set_parent_*. |
Method | _set_merges_from_parent_ids | Undocumented |
Method | _filter_parent_ids_by_ancestry | Check that all merged revisions are proper 'heads'. |
Method | _sha_from_stat | Get a sha digest from the tree's stat cache. |
Method | _put_rio | Undocumented |
Method | _setup_directory_is_tree_reference | Undocumented |
Method | _directory_is_never_tree_reference | Undocumented |
Method | _directory_may_be_tree_reference | Undocumented |
Method | _kind | Undocumented |
Method | _flush_ignore_list_cache | Resets the cached ignore list to force a cache rebuild. |
Method | _comparison_data | Undocumented |
Method | _file_size | Undocumented |
Method | _last_revision | helper for get_parent_ids. |
Method | _must_be_locked | Undocumented |
Method | _change_last_revision | Template method part of set_last_revision to perform the change. |
Method | _update_tree | Update a tree to the master branch. |
Method | _validate | Validate internal structures. |
Method | _get_rules_searcher | See Tree._get_rules_searcher. |
Inherited from MutableTree (via WorkingTree):
Method | add | Add paths to the set of versioned paths. |
Method | add_reference | Add a TreeReference to the tree, pointing at sub_tree |
Method | apply_inventory_delta | Apply changes to the inventory as an atomic operation. |
Method | commit | Undocumented |
Method | has_changes | Quickly check that the tree contains at least one commitable change. |
Method | check_changed_or_out_of_date | Check the tree for uncommitted changes and branch synchronization. |
Method | smart_add | Version file_list, optionally recursing into directories. |
Method | _add_reference | Standard add_reference implementation, for use by subclasses |
Method | _observed_sha1 | Tell the tree we have observed a paths sha1. |
Inherited from MutableInventoryTree:
Method | apply_inventory_delta | Apply changes to the inventory as an atomic operation. |
Method | smart_add | Version file_list, optionally recursing into directories. |
Method | update_basis_by_delta | Update the parents of this tree after a commit. |
Method | _fix_case_of_inventory_path | If our tree isn't case sensitive, return the canonical path |
Inherited from MutableTree (via MutableInventoryTree):
Method | is_control_filename | True if filename is the name of a control file in this tree. |
Method | add | Add paths to the set of versioned paths. |
Method | add_reference | Add a TreeReference to the tree, pointing at sub_tree |
Method | commit | Undocumented |
Method | has_changes | Quickly check that the tree contains at least one commitable change. |
Method | check_changed_or_out_of_date | Check the tree for uncommitted changes and branch synchronization. |
Method | last_revision | Return the revision id of the last commit performed in this tree. |
Method | lock_tree_write | Lock the working tree for write, and the branch for read. |
Method | lock_write | Lock the tree and its branch. This allows mutating calls to be made. |
Method | mkdir | Create a directory in the tree. if file_id is None, one is assigned. |
Method | put_file_bytes_non_atomic | Update the content of a file in the tree. |
Method | set_parent_ids | Set the parents ids of the working tree. |
Method | _add_reference | Standard add_reference implementation, for use by subclasses |
Method | _gather_kinds | Helper function for add - sets the entries of kinds. |
Method | _observed_sha1 | Tell the tree we have observed a paths sha1. |
Parameters | branch | A branch to override probing for the branch. |
Parameters | inv | The inventory to set. |
dirty | A boolean indicating whether the inventory is the same logical inventory as whats on disk. If True the inventory is not the same and should be written to disk or data will be lost, if False then the inventory is the same as that on disk and any serialisation would be unneeded overhead. |
Parameters | file_id | The file id to assign to the root. It must not be present in the current inventory or an error will occur. It must not be None, but rather a valid file id. |
Raises | errors.InventoryModified | read_working_inventory will fail when the current in memory inventory has been modified. |
file_ids are in a WorkingTree if they are in the working inventory and the working file exists.
The default implementation returns no refs, and is only suitable for trees that have no local caching and can commit on ghosts at any time.
See Also | bzrlib.check for details about check_refs. |
Parameters | references | A dict with keys matching the items returned by self._get_check_refs(), and values from looking those keys up in the repository. |
This does a hard-reset to a last-known-good state. This is a way to fix if something got corrupted (like the .bzr/checkout/dirstate file)
This implementation will use the basis tree implementation if possible. Lines not in the basis are attributed to CURRENT_REVISION
If there are pending merges, lines added by those merges will be incorrectly attributed to CURRENT_REVISION (but after committing, the attribution will be correct).
The list is initialized by WorkingTree.set_merge_modified, which is typically called after we make some automatic updates to the tree because of a merge.
This returns a map of file_id->sha1, containing only files which are still in the working inventory and have that text hash.
A new branch will be created, relative to the path for this tree.
Lists, but does not descend into unversioned directories. This does not include files that have been deleted in this tree. Skips the control directory.
Parameters | include_root | if True, return an entry for the root |
from_dir | start from this directory or None for the root | |
recursive | whether to recurse into subdirectories or not |
to_dir must exist in the inventory.
If to_dir exists and is a directory, the files are moved into it, keeping their old names.
Note that to_dir is only the last component of the new name; this doesn't change the directory.
For each entry in from_paths the move mode will be determined independently.
The first mode moves the file in the filesystem and updates the inventory. The second mode only updates the inventory without touching the file on the filesystem.
move uses the second mode if 'after == True' and the target is either not versioned or newly added, and present in the working tree.
move uses the second mode if 'after == False' and the source is versioned but no longer in the working tree, and the target is not versioned but present in the working tree.
move uses the first mode if 'after == False' and the source is versioned and present in the working tree, and the target is not versioned and not present in the working tree.
Everything else results in an error.
This returns a list of (from_path, to_path) pairs for each entry that is moved.
This can change the directory or the filename or both.
rename_one has several 'modes' to work. First, it can rename a physical file and change the file_id. That is the normal mode. Second, it can only change the file_id without touching any physical file.
rename_one uses the second mode if 'after == True' and 'to_rel' is not versioned but present in the working tree.
rename_one uses the second mode if 'after == False' and 'from_rel' is versioned but no longer in the working tree, and 'to_rel' is not versioned but present in the working tree.
rename_one uses the first mode if 'after == False' and 'from_rel' is versioned and present in the working tree, and 'to_rel' is not versioned and not present in the working tree.
Everything else results in an error.
Also does basic plausability tests.
Depending on the value of the flag 'only_change_inv', the file will be moved on the file system or not.
When a file_id is unversioned, all of its children are automatically unversioned.
Parameters | file_ids | The file ids to stop versioning. |
Raises | NoSuchId if any fileid is not currently versioned. |
If there are any unversioned directories then only the directory is returned, not all its children. But if there are unversioned files under a versioned subdirectory, they are returned.
Currently returned depth-first, sorted by name within directories. This is the same order used by 'osutils.walkdirs'.
Walk the directories of this tree. :param prefix: is used as the directrory to start with. :returns: a generator which yields items in the form:: ((curren_directory_path, fileid), [(file1_path, file1_name, file1_kind, None, file1_id, file1_kind), ... ])