pub struct RevisionTree(pub Py<PyAny>);Expand description
A read-only tree at a specific revision.
Tuple Fields§
§0: Py<PyAny>Implementations§
Source§impl RevisionTree
impl RevisionTree
Sourcepub fn repository(&self) -> GenericRepository
pub fn repository(&self) -> GenericRepository
Get the repository this revision tree belongs to.
Sourcepub fn get_revision_id(&self) -> RevisionId
pub fn get_revision_id(&self) -> RevisionId
Get the revision ID of this tree.
Sourcepub fn get_parent_ids(&self) -> Vec<RevisionId>
pub fn get_parent_ids(&self) -> Vec<RevisionId>
Get the parent revision IDs of this tree.
Trait Implementations§
Source§impl Clone for RevisionTree
impl Clone for RevisionTree
Source§impl<'py> IntoPyObject<'py> for RevisionTree
impl<'py> IntoPyObject<'py> for RevisionTree
Source§type Output = Bound<'py, <RevisionTree as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <RevisionTree as IntoPyObject<'py>>::Target>
The smart pointer type to use. Read more
Source§type Error = Infallible
type Error = Infallible
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for RevisionTree
impl !RefUnwindSafe for RevisionTree
impl Send for RevisionTree
impl Sync for RevisionTree
impl Unpin for RevisionTree
impl UnwindSafe for RevisionTree
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
Mutably borrows from an owned value. Read more
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>
Converts
self into an owned Python object, dropping type information.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>
Get a dictionary of tags and their revision IDs.
Source§fn get_file(&self, path: &Path) -> Result<Box<dyn Read>, Error>
fn get_file(&self, path: &Path) -> Result<Box<dyn Read>, Error>
Get a file from the tree as a readable stream.
Source§fn get_file_text(&self, path: &Path) -> Result<Vec<u8>, Error>
fn get_file_text(&self, path: &Path) -> Result<Vec<u8>, Error>
Get the contents of a file from the tree as a byte vector.
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>
Get the contents of a file as a vector of lines (byte vectors).
Source§fn has_filename(&self, path: &Path) -> bool
fn has_filename(&self, path: &Path) -> bool
Check if a file exists in the tree at the specified path.
Source§fn get_symlink_target(&self, path: &Path) -> Result<PathBuf, Error>
fn get_symlink_target(&self, path: &Path) -> Result<PathBuf, Error>
Get the target of a symbolic link.
Source§fn get_parent_ids(&self) -> Result<Vec<RevisionId>, Error>
fn get_parent_ids(&self) -> Result<Vec<RevisionId>, Error>
Get the IDs of the parent revisions of this tree.
Source§fn is_ignored(&self, path: &Path) -> Option<String>
fn is_ignored(&self, path: &Path) -> Option<String>
Check if a path is ignored by version control.
Source§fn kind(&self, path: &Path) -> Result<Kind, Error>
fn kind(&self, path: &Path) -> Result<Kind, Error>
Get the kind of object at the specified path (file, directory, symlink, etc.).
Source§fn is_versioned(&self, path: &Path) -> bool
fn is_versioned(&self, path: &Path) -> bool
Check if a path is under version control.
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>
Iterate through the changes between this tree and another tree. Read more
Source§fn has_versioned_directories(&self) -> bool
fn has_versioned_directories(&self) -> bool
Check if this tree supports versioned directories.
Source§fn preview_transform(&self) -> Result<TreeTransform, Error>
fn preview_transform(&self) -> Result<TreeTransform, Error>
Get a preview of transformations that would be applied to this tree.
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>
List files in the tree, optionally recursively. Read more
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>
Iterate through entries in a directory. Read more
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>
Get the SHA1 hash of a file’s contents.
Source§fn get_file_mtime(&self, path: &Path) -> Result<u64, Error>
fn get_file_mtime(&self, path: &Path) -> Result<u64, Error>
Get the modification time of a file.
Source§fn stored_kind(&self, path: &Path) -> Result<Kind, Error>
fn stored_kind(&self, path: &Path) -> Result<Kind, Error>
Get the stored kind of a file (as opposed to the actual kind on disk).
Source§fn supports_content_filtering(&self) -> bool
fn supports_content_filtering(&self) -> bool
Check if the tree supports content filtering.
Source§fn supports_file_ids(&self) -> bool
fn supports_file_ids(&self) -> bool
Check if the tree supports file IDs.
Source§fn supports_rename_tracking(&self) -> bool
fn supports_rename_tracking(&self) -> bool
Check if the tree supports rename tracking.
Source§fn supports_symlinks(&self) -> bool
fn supports_symlinks(&self) -> bool
Check if the tree supports symbolic links.
Source§fn supports_tree_reference(&self) -> bool
fn supports_tree_reference(&self) -> bool
Check if the tree supports tree references.
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>
Get all versioned paths in the tree.
Source§fn filter_unversioned_files(
&self,
paths: &[&Path],
) -> Result<Vec<PathBuf>, Error>
fn filter_unversioned_files( &self, paths: &[&Path], ) -> Result<Vec<PathBuf>, Error>
Filter out versioned files from a list of paths.
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>
Walk directories in the tree.
Source§fn versionable_kind(&self, kind: &Kind) -> bool
fn versionable_kind(&self, kind: &Kind) -> bool
Check if a file kind is versionable.
Source§fn path_content_summary(&self, path: &Path) -> Result<PathContentSummary, Error>
fn path_content_summary(&self, path: &Path) -> Result<PathContentSummary, Error>
Get file content summary for a path.
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>
Iterate through file bytes.
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>
Iterate through entries by directory.
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>
Get file verifier information.
Source§fn get_reference_revision(&self, path: &Path) -> Result<RevisionId, Error>
fn get_reference_revision(&self, path: &Path) -> Result<RevisionId, Error>
Get the reference revision for a tree reference.
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>
Create an archive of the tree.
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>
Annotate a file with revision information.
Source§fn is_special_path(&self, path: &Path) -> bool
fn is_special_path(&self, path: &Path) -> bool
Check if a path is a special path (e.g., control directory).