RevisionTree

Struct RevisionTree 

Source
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

Source

pub fn repository(&self) -> GenericRepository

Get the repository this revision tree belongs to.

Source

pub fn get_revision_id(&self) -> RevisionId

Get the revision ID of this tree.

Source

pub fn get_parent_ids(&self) -> Vec<RevisionId>

Get the parent revision IDs of this tree.

Trait Implementations§

Source§

impl Clone for RevisionTree

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'py> IntoPyObject<'py> for RevisionTree

Source§

type Target = PyAny

The Python output type
Source§

type Output = Bound<'py, <RevisionTree as IntoPyObject<'py>>::Target>

The smart pointer type to use. Read more
Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn into_pyobject(self, py: Python<'py>) -> Result<Self::Output, Self::Error>

Performs the conversion.
Source§

impl PyTree for RevisionTree

Source§

fn to_object(&self, py: Python<'_>) -> Py<PyAny>

Get the underlying Python object for this tree.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<'py, T> IntoPyObjectExt<'py> for T
where T: IntoPyObject<'py>,

Source§

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§

fn into_py_any(self, py: Python<'py>) -> Result<Py<PyAny>, PyErr>

Converts self into an owned Python object, dropping type information and unbinding it from the 'py lifetime.
Source§

fn into_pyobject_or_pyerr(self, py: Python<'py>) -> Result<Self::Output, PyErr>

Converts self into a Python object. Read more
Source§

impl<T> PyErrArguments for T
where T: for<'py> IntoPyObject<'py> + Send + Sync,

Source§

fn arguments(self, py: Python<'_>) -> Py<PyAny>

Arguments for exception
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> Tree for T
where T: PyTree + ?Sized,

Source§

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>

Get a file from the tree as a readable stream.
Source§

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>

Get the contents of a file as a vector of lines (byte vectors).
Source§

fn lock_read(&self) -> Result<Lock, Error>

Lock the tree for read operations.
Source§

fn has_filename(&self, path: &Path) -> bool

Check if a file exists in the tree at the specified path.
Get the target of a symbolic link.
Source§

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>

Check if a path is ignored by version control.
Source§

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

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>

Iterate through the changes between this tree and another tree. Read more
Source§

fn has_versioned_directories(&self) -> bool

Check if this tree supports versioned directories.
Source§

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>

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>

Iterate through entries in a directory. Read more
Source§

fn get_file_size(&self, path: &Path) -> Result<u64, Error>

Get the size of a file in bytes.
Source§

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>

Get the modification time of a file.
Source§

fn is_executable(&self, path: &Path) -> Result<bool, Error>

Check if a file is executable.
Source§

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

Check if the tree supports content filtering.
Source§

fn supports_file_ids(&self) -> bool

Check if the tree supports file IDs.
Source§

fn supports_rename_tracking(&self) -> bool

Check if the tree supports rename tracking.
Check if the tree supports symbolic links.
Source§

fn supports_tree_reference(&self) -> bool

Check if the tree supports tree references.
Source§

fn unknowns(&self) -> Result<Vec<PathBuf>, Error>

Get unversioned files in the tree.
Source§

fn all_versioned_paths( &self, ) -> Result<Box<dyn Iterator<Item = Result<PathBuf, Error>>>, Error>

Get all versioned paths in the tree.
Source§

fn conflicts(&self) -> Result<Vec<Conflict>, Error>

Get conflicts in the tree.
Source§

fn extras(&self) -> Result<Vec<PathBuf>, Error>

Get extra (unversioned) files in the tree.
Source§

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>

Walk directories in the tree.
Source§

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>

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>

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>

Iterate through entries by directory.
Source§

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>

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>

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>

Annotate a file with revision information.
Source§

fn is_special_path(&self, path: &Path) -> bool

Check if a path is a special path (e.g., control directory).
Source§

fn iter_search_rules( &self, paths: &[&Path], ) -> Result<Box<dyn Iterator<Item = Result<SearchRule, Error>>>, Error>

Iterate through search rules.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Ungil for T
where T: Send,