ok/jj
1
0
Fork 0
forked from mirrors/jj

Fix documentation for RevsetExpression::ancestors_at and descendants_at

The current documentation is wrong. This is a follow up for
https://github.com/martinvonz/jj/pull/3461#discussion_r1555011289
This commit is contained in:
Evan Mesterhazy 2024-04-07 23:54:35 -04:00 committed by Evan Mesterhazy
parent feaaa48ed0
commit 379849b4b8

View file

@ -489,7 +489,8 @@ impl RevsetExpression {
self.ancestors_range(GENERATION_RANGE_FULL)
}
/// Ancestors of `self`, including `self` until `generation` back.
/// Ancestors of `self` at an offset of `generation` behind `self`.
/// The `generation` offset is zero-based starting from `self`.
pub fn ancestors_at(self: &Rc<RevsetExpression>, generation: u64) -> Rc<RevsetExpression> {
self.ancestors_range(generation..(generation + 1))
}
@ -521,7 +522,8 @@ impl RevsetExpression {
})
}
/// Descendants of `self`, including `self` until `generation` ahead.
/// Descendants of `self` at an offset of `generation` ahead of `self`.
/// The `generation` offset is zero-based starting from `self`.
pub fn descendants_at(self: &Rc<RevsetExpression>, generation: u64) -> Rc<RevsetExpression> {
Rc::new(RevsetExpression::Descendants {
roots: self.clone(),