Type Alias jj_lib::merge::MergedTreeValue

source ·
pub type MergedTreeValue = Merge<Option<TreeValue>>;
Expand description

The value at a given path in a commit. It depends on the context whether it can be absent (Merge::is_absent()). For example, when getting the value at a specific path, it may be, but when iterating over entries in a tree, it shouldn’t be.

Aliased Type§

struct MergedTreeValue { /* private fields */ }

Implementations§

source§

impl MergedTreeValue

source

pub fn from_backend_conflict(conflict: Conflict) -> Self

Create a Merge from a backend::Conflict, padding with None to make sure that there is exactly one more adds() than removes().

source

pub fn into_backend_conflict(self) -> Conflict

Creates a backend::Conflict from a Merge by dropping None values. Note that the conversion is lossy: the order of None values is not preserved when converting back to a Merge.

source

pub fn is_tree(&self) -> bool

Whether this merge should be recursed into when doing directory walks.

source

pub fn to_file_merge(&self) -> Option<Merge<Option<FileId>>>

If this merge contains only files or absent entries, returns a merge of the FileIds. The executable bits will be ignored. Use Merge::with_new_file_ids()` to produce a new merge with the original executable bits preserved.

source

pub fn with_new_file_ids(&self, file_ids: &Merge<Option<FileId>>) -> Self

Creates a new merge with the file ids from the given merge. In other words, only the executable bits from self will be preserved.

source

pub fn describe(&self, file: &mut dyn Write) -> Result<()>

Give a summary description of the conflict’s “removes” and “adds”