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
impl MergedTreeValue
sourcepub fn from_backend_conflict(conflict: Conflict) -> Self
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()
.
sourcepub fn into_backend_conflict(self) -> Conflict
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
.
sourcepub fn is_tree(&self) -> bool
pub fn is_tree(&self) -> bool
Whether this merge should be recursed into when doing directory walks.
sourcepub fn to_file_merge(&self) -> Option<Merge<Option<FileId>>>
pub fn to_file_merge(&self) -> Option<Merge<Option<FileId>>>
If this merge contains only files or absent entries, returns a merge of
the FileId
s. The executable bits will be ignored. Use
Merge::with_new_file_ids()` to produce a new merge with the original
executable bits preserved.
sourcepub fn to_executable_merge(&self) -> Option<Merge<bool>>
pub fn to_executable_merge(&self) -> Option<Merge<bool>>
If this merge contains only files or absent entries, returns a merge of the files’ executable bits.
sourcepub fn with_new_file_ids(&self, file_ids: &Merge<Option<FileId>>) -> Self
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.