mirror of
https://github.com/martinvonz/jj.git
synced 2025-02-01 00:50:57 +00:00
b54ace4954
When rebasing descendants, we generally move branches, child commits, the working copy to the rewritten commit(s). However, we don't move the working copy to the new rewritten commit (s) if the old commit had been abandoned, and we don't move child commits if the rewriten was divergent. This patch aims to make it clearer that there's only one mapping from old to new parents, and that is in `parent_mapping`. It does so by merging the current `divergent` map into it, and makes the `divergent` just a set instead. When finding the new parents for a child, we leave the existing parent if it's in the set. My longer-term goal is to move `parent_mapping`, `abandoned`, and `divergent` into `MutableRepo` (maybe in a nested struct), so we can do some transformations on descendants as we rebase them. By having the state in a single place (not moving it from `MutableRepo` to `DescendantRebaser` as we currently do), I hope it will be easier to write a `MutableRepo::transform_descendants(callback)`, where the callback gets a `CommitBuilder` and can change parents of the commit, for example. |
||
---|---|---|
.. | ||
benches | ||
gen-protos | ||
proc-macros | ||
src | ||
tests | ||
testutils | ||
Cargo.toml | ||
LICENSE |