pub struct GenericWorkingTree(pub Py<PyAny>);Expand description
A working tree in a version control system.
A working tree is a local directory containing the files of a branch that can be edited. This struct wraps a Python working tree object and provides access to its functionality.
Tuple Fields§
§0: Py<PyAny>Implementations§
Source§impl GenericWorkingTree
impl GenericWorkingTree
Sourcepub fn open_containing(
path: &Path,
) -> Result<(GenericWorkingTree, PathBuf), Error>
👎Deprecated: Use ::open_containing instead
pub fn open_containing( path: &Path, ) -> Result<(GenericWorkingTree, PathBuf), Error>
Use ::open_containing instead
Open a working tree containing the specified path.
This method is deprecated, use the module-level open_containing function instead.
§Parameters
path- The path to look for a containing working tree.
§Returns
A tuple containing the working tree and the relative path, or an error if no containing working tree could be found.
Sourcepub fn commit(
&self,
message: &str,
committer: Option<&str>,
timestamp: Option<f64>,
allow_pointless: Option<bool>,
specific_files: Option<&[&Path]>,
) -> Result<RevisionId, Error>
👎Deprecated: Use build_commit instead
pub fn commit( &self, message: &str, committer: Option<&str>, timestamp: Option<f64>, allow_pointless: Option<bool>, specific_files: Option<&[&Path]>, ) -> Result<RevisionId, Error>
Use build_commit instead
Create a commit with the specified parameters.
This method is deprecated, use the build_commit method instead.
§Parameters
message- The commit message.allow_pointless- Whether to allow commits that don’t change any files.committer- The committer’s name and email.specific_files- The paths of files to include in this commit.
§Returns
The revision ID of the new commit, or an error if the commit could not be created.
Trait Implementations§
Source§impl Clone for GenericWorkingTree
impl Clone for GenericWorkingTree
Source§impl From<GenericWorkingTree> for CommitBuilder
impl From<GenericWorkingTree> for CommitBuilder
Source§impl From<Py<PyAny>> for GenericWorkingTree
Implementation of From<Py> for GenericWorkingTree.
impl From<Py<PyAny>> for GenericWorkingTree
Implementation of From<Py
Source§impl<'py> IntoPyObject<'py> for GenericWorkingTree
impl<'py> IntoPyObject<'py> for GenericWorkingTree
Source§type Output = Bound<'py, <GenericWorkingTree as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <GenericWorkingTree as IntoPyObject<'py>>::Target>
Source§type Error = Infallible
type Error = Infallible
Source§impl PyTree for GenericWorkingTree
impl PyTree for GenericWorkingTree
impl PyMutableTree for GenericWorkingTree
impl PyWorkingTree for GenericWorkingTree
Auto Trait Implementations§
impl Freeze for GenericWorkingTree
impl !RefUnwindSafe for GenericWorkingTree
impl Send for GenericWorkingTree
impl Sync for GenericWorkingTree
impl Unpin for GenericWorkingTree
impl UnsafeUnpin for GenericWorkingTree
impl UnwindSafe for GenericWorkingTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.Source§impl<T> MutableTree for Twhere
T: PyMutableTree + ?Sized,
impl<T> MutableTree for Twhere
T: PyMutableTree + ?Sized,
Source§fn put_file_bytes_non_atomic(
&self,
path: &Path,
data: &[u8],
) -> Result<(), Error>
fn put_file_bytes_non_atomic( &self, path: &Path, data: &[u8], ) -> Result<(), Error>
Source§fn remove(&self, files: &[&Path]) -> Result<(), Error>
fn remove(&self, files: &[&Path]) -> Result<(), Error>
Source§fn add_reference(&self, reference: &TreeReference) -> Result<(), Error>
fn add_reference(&self, reference: &TreeReference) -> Result<(), Error>
Source§fn copy_one(&self, from_path: &Path, to_path: &Path) -> Result<(), Error>
fn copy_one(&self, from_path: &Path, to_path: &Path) -> Result<(), Error>
Source§fn last_revision(&self) -> Result<RevisionId, Error>
fn last_revision(&self) -> Result<RevisionId, Error>
Source§fn set_parent_ids(&self, parent_ids: &[RevisionId]) -> Result<(), Error>
fn set_parent_ids(&self, parent_ids: &[RevisionId]) -> Result<(), Error>
Source§fn set_parent_trees(
&self,
parent_trees: &[(RevisionId, RevisionTree)],
) -> Result<(), Error>
fn set_parent_trees( &self, parent_trees: &[(RevisionId, RevisionTree)], ) -> Result<(), Error>
Source§fn apply_inventory_delta(&self, delta: Vec<InventoryDelta>) -> Result<(), Error>
fn apply_inventory_delta(&self, delta: Vec<InventoryDelta>) -> Result<(), Error>
Source§impl<T> PyErrArguments for T
impl<T> PyErrArguments for T
Source§impl<T> Tree for T
impl<T> Tree for T
Source§fn get_tag_dict(&self) -> Result<HashMap<String, RevisionId>, Error>
fn get_tag_dict(&self) -> Result<HashMap<String, RevisionId>, Error>
Source§fn get_file(&self, path: &Path) -> Result<Box<dyn Read>, Error>
fn get_file(&self, path: &Path) -> Result<Box<dyn Read>, Error>
Source§fn get_file_text(&self, path: &Path) -> Result<Vec<u8>, Error>
fn get_file_text(&self, path: &Path) -> Result<Vec<u8>, Error>
Source§fn get_file_lines(&self, path: &Path) -> Result<Vec<Vec<u8>>, Error>
fn get_file_lines(&self, path: &Path) -> Result<Vec<Vec<u8>>, Error>
Source§fn has_filename(&self, path: &Path) -> bool
fn has_filename(&self, path: &Path) -> bool
Source§fn get_symlink_target(&self, path: &Path) -> Result<PathBuf, Error>
fn get_symlink_target(&self, path: &Path) -> Result<PathBuf, Error>
Source§fn get_parent_ids(&self) -> Result<Vec<RevisionId>, Error>
fn get_parent_ids(&self) -> Result<Vec<RevisionId>, Error>
Source§fn is_ignored(&self, path: &Path) -> Option<String>
fn is_ignored(&self, path: &Path) -> Option<String>
Source§fn kind(&self, path: &Path) -> Result<Kind, Error>
fn kind(&self, path: &Path) -> Result<Kind, Error>
Source§fn is_versioned(&self, path: &Path) -> bool
fn is_versioned(&self, path: &Path) -> bool
Source§fn iter_changes(
&self,
other: &(dyn PyTree + 'static),
specific_files: Option<&[&Path]>,
want_unversioned: Option<bool>,
require_versioned: Option<bool>,
) -> Result<Box<dyn Iterator<Item = Result<TreeChange, Error>>>, Error>
fn iter_changes( &self, other: &(dyn PyTree + 'static), specific_files: Option<&[&Path]>, want_unversioned: Option<bool>, require_versioned: Option<bool>, ) -> Result<Box<dyn Iterator<Item = Result<TreeChange, Error>>>, Error>
Source§fn has_versioned_directories(&self) -> bool
fn has_versioned_directories(&self) -> bool
Source§fn preview_transform(&self) -> Result<TreeTransform, Error>
fn preview_transform(&self) -> Result<TreeTransform, Error>
Source§fn list_files(
&self,
include_root: Option<bool>,
from_dir: Option<&Path>,
recursive: Option<bool>,
recurse_nested: Option<bool>,
) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, bool, Kind, TreeEntry), Error>>>, Error>
fn list_files( &self, include_root: Option<bool>, from_dir: Option<&Path>, recursive: Option<bool>, recurse_nested: Option<bool>, ) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, bool, Kind, TreeEntry), Error>>>, Error>
Source§fn iter_child_entries(
&self,
path: &Path,
) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, Kind, TreeEntry), Error>>>, Error>
fn iter_child_entries( &self, path: &Path, ) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, Kind, TreeEntry), Error>>>, Error>
Source§fn get_file_sha1(
&self,
path: &Path,
_stat_value: Option<&Metadata>,
) -> Result<String, Error>
fn get_file_sha1( &self, path: &Path, _stat_value: Option<&Metadata>, ) -> Result<String, Error>
Source§fn get_file_mtime(&self, path: &Path) -> Result<u64, Error>
fn get_file_mtime(&self, path: &Path) -> Result<u64, Error>
Source§fn stored_kind(&self, path: &Path) -> Result<Kind, Error>
fn stored_kind(&self, path: &Path) -> Result<Kind, Error>
Source§fn supports_content_filtering(&self) -> bool
fn supports_content_filtering(&self) -> bool
Source§fn supports_file_ids(&self) -> bool
fn supports_file_ids(&self) -> bool
Source§fn supports_rename_tracking(&self) -> bool
fn supports_rename_tracking(&self) -> bool
Source§fn supports_symlinks(&self) -> bool
fn supports_symlinks(&self) -> bool
Source§fn supports_tree_reference(&self) -> bool
fn supports_tree_reference(&self) -> bool
Source§fn all_versioned_paths(
&self,
) -> Result<Box<dyn Iterator<Item = Result<PathBuf, Error>>>, Error>
fn all_versioned_paths( &self, ) -> Result<Box<dyn Iterator<Item = Result<PathBuf, Error>>>, Error>
Source§fn filter_unversioned_files(
&self,
paths: &[&Path],
) -> Result<Vec<PathBuf>, Error>
fn filter_unversioned_files( &self, paths: &[&Path], ) -> Result<Vec<PathBuf>, Error>
Source§fn walkdirs(
&self,
prefix: Option<&Path>,
) -> Result<Box<dyn Iterator<Item = Result<WalkdirResult, Error>>>, Error>
fn walkdirs( &self, prefix: Option<&Path>, ) -> Result<Box<dyn Iterator<Item = Result<WalkdirResult, Error>>>, Error>
Source§fn versionable_kind(&self, kind: &Kind) -> bool
fn versionable_kind(&self, kind: &Kind) -> bool
Source§fn path_content_summary(&self, path: &Path) -> Result<PathContentSummary, Error>
fn path_content_summary(&self, path: &Path) -> Result<PathContentSummary, Error>
Source§fn iter_files_bytes(
&self,
paths: &[&Path],
) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, Vec<u8>), Error>>>, Error>
fn iter_files_bytes( &self, paths: &[&Path], ) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, Vec<u8>), Error>>>, Error>
Source§fn iter_entries_by_dir(
&self,
specific_files: Option<&[&Path]>,
) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, TreeEntry), Error>>>, Error>
fn iter_entries_by_dir( &self, specific_files: Option<&[&Path]>, ) -> Result<Box<dyn Iterator<Item = Result<(PathBuf, TreeEntry), Error>>>, Error>
Source§fn get_file_verifier(
&self,
path: &Path,
_stat_value: Option<&Metadata>,
) -> Result<(String, Vec<u8>), Error>
fn get_file_verifier( &self, path: &Path, _stat_value: Option<&Metadata>, ) -> Result<(String, Vec<u8>), Error>
Source§fn get_reference_revision(&self, path: &Path) -> Result<RevisionId, Error>
fn get_reference_revision(&self, path: &Path) -> Result<RevisionId, Error>
Source§fn archive(
&self,
format: &str,
name: &str,
root: Option<&str>,
subdir: Option<&Path>,
force_mtime: Option<f64>,
recurse_nested: bool,
) -> Result<Box<dyn Iterator<Item = Result<Vec<u8>, Error>>>, Error>
fn archive( &self, format: &str, name: &str, root: Option<&str>, subdir: Option<&Path>, force_mtime: Option<f64>, recurse_nested: bool, ) -> Result<Box<dyn Iterator<Item = Result<Vec<u8>, Error>>>, Error>
Source§fn annotate_iter(
&self,
path: &Path,
default_revision: Option<&RevisionId>,
) -> Result<Box<dyn Iterator<Item = Result<(RevisionId, Vec<u8>), Error>>>, Error>
fn annotate_iter( &self, path: &Path, default_revision: Option<&RevisionId>, ) -> Result<Box<dyn Iterator<Item = Result<(RevisionId, Vec<u8>), Error>>>, Error>
Source§fn is_special_path(&self, path: &Path) -> bool
fn is_special_path(&self, path: &Path) -> bool
Source§impl<T> WorkingTree for Twhere
T: PyWorkingTree + ?Sized,
impl<T> WorkingTree for Twhere
T: PyWorkingTree + ?Sized,
Source§fn revision_tree(
&self,
revision_id: &RevisionId,
) -> Result<Box<RevisionTree>, Error>
fn revision_tree( &self, revision_id: &RevisionId, ) -> Result<Box<RevisionTree>, Error>
Get a revision tree for a specific revision.
Source§fn abspath(&self, path: &Path) -> Result<PathBuf, Error>
fn abspath(&self, path: &Path) -> Result<PathBuf, Error>
Convert a path to an absolute path relative to the working tree.
Source§fn relpath(&self, path: &Path) -> Result<PathBuf, Error>
fn relpath(&self, path: &Path) -> Result<PathBuf, Error>
Convert an absolute path to a path relative to the working tree.
Source§fn pull(
&self,
source: &dyn Branch,
overwrite: Option<bool>,
stop_revision: Option<&RevisionId>,
local: Option<bool>,
) -> Result<(), Error>
fn pull( &self, source: &dyn Branch, overwrite: Option<bool>, stop_revision: Option<&RevisionId>, local: Option<bool>, ) -> Result<(), Error>
Pull changes from another branch into this working tree.
Source§fn merge_from_branch(
&self,
source: &dyn Branch,
to_revision: Option<&RevisionId>,
) -> Result<(), Error>
fn merge_from_branch( &self, source: &dyn Branch, to_revision: Option<&RevisionId>, ) -> Result<(), Error>
Merge changes from another branch into this working tree.
Source§fn safe_relpath_files(
&self,
file_list: &[&Path],
canonicalize: bool,
apply_view: bool,
) -> Result<Vec<PathBuf>, Error>
fn safe_relpath_files( &self, file_list: &[&Path], canonicalize: bool, apply_view: bool, ) -> Result<Vec<PathBuf>, Error>
Convert a list of files to relative paths safely.