mirror of
https://github.com/martinvonz/jj.git
synced 2024-12-28 23:55:54 +00:00
0c8a116771
The `DescendantRebaser` was designed to help with rebasing in two different use cases: 1) after regular rewriting of commits where the change ID is preserved, and 2) after importing moved branches from other repo (e.g. backing Git repo or remote). Many of the tests are for the second use case, such as where a branch was moved forward. However, I just noticed that there's a pretty common scenario from the first use case that is not supported. Let's say you have this history: ``` D | C C' |/ B B' |/ A ``` Here we want C' to be rebased onto B' and then D to be rebased onto C''. However, because of the support for moving branches forward, we would not rebase commits that were already rewritten, such as C' here (see affected tests for details), which resulted in D getting rebased onto C', and both B and B' remaining visible. I think I was thinking when I designed it that it would be nice if you could just tell `DescendantRebaser` that any descendants of a commit should be moved forward. That may be useful, but I don't think we'll want that for the general case of a branch moving forward. Perhaps we'll want to make it configurable which branches it should happen for. Either way, the way it was coded by not rebasing already rewritten commits did not work for the case above. We may be able to handle both cases better by considering each rewrite separately instead of all destinations at once. For now, however, I've decided to keep it simple, so I'm fixing the case above by sacrificing some of the potentially useful functionality for moving branches forward. Another fix necessary for the scenario shown above was to make sure we always rebase C' before D. Before this patch, that depended on the order in the index. This patch fixes that by modifying the topological order to take rewrites into account, making D depend not only on C but also on C'. (I suppose you could instead say that C depends on both B and C'; I don't know if that'd make a difference.) |
||
---|---|---|
.. | ||
test_bad_locking.rs | ||
test_commit_builder.rs | ||
test_commit_concurrent.rs | ||
test_conflicts.rs | ||
test_diff_summary.rs | ||
test_git.rs | ||
test_index.rs | ||
test_init.rs | ||
test_load_repo.rs | ||
test_merge_trees.rs | ||
test_mut_repo.rs | ||
test_operations.rs | ||
test_refs.rs | ||
test_revset.rs | ||
test_revset_graph_iterator.rs | ||
test_rewrite.rs | ||
test_view.rs | ||
test_working_copy.rs | ||
test_working_copy_concurrent.rs | ||
test_workspace.rs |