mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-20 03:20:08 +00:00
e55d03a2ee
This helps add library API that takes resolved revset expressions. For example, "jj absorb" will first compute annotation within a user-specified ancestor range such as "mutable()". Because the range expression may contain symbols, it should be resolved by caller. There are two ideas to check resolution state at compile time: <https://github.com/martinvonz/jj/pull/4374> a. add RevsetExpressionWrapper<PhantomState> and guarantee inner tree consistency at public API boundary b. parameterize RevsetExpression variant types in a way that invalid variants can never be constructed (a) is nice if we want to combine "resolved" and "unresolved" expressions. The inner expression types are the same, so we can just calculate new state as Resolved & Unresolved = Unresolved. (b) is stricter as the compiler can guarantee invariants. This patch implements (b) because there are no existing callers who need to construct "resolved" expression and convert it to "user" expression. .evaluate_programmatic() now requires that the expression is resolved. |
||
---|---|---|
.. | ||
custom-backend | ||
custom-command | ||
custom-commit-templater | ||
custom-global-flag | ||
custom-operation-templater | ||
custom-working-copy |