jj/lib/tests
Martin von Zweigbergk 0c8a116771 rewrite: fix auto-rebasing after "branchy" rewrites
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.)
2022-01-27 22:20:14 -08:00
..
test_bad_locking.rs workspace: move search for .jj/ directory from Repo to Workspace 2021-11-25 21:08:43 -08:00
test_commit_builder.rs transaction: remove Drop implementation 2021-12-01 10:31:35 -08:00
test_commit_concurrent.rs workspace: move search for .jj/ directory from Repo to Workspace 2021-11-25 21:08:43 -08:00
test_conflicts.rs tests: extract variable for store in test_conflicts 2021-11-25 21:04:56 -08:00
test_diff_summary.rs testutils: make init_repo return a struct, including a Workspace 2021-11-25 21:04:56 -08:00
test_git.rs git: on import, only add ref target as head if target changed (#44) 2021-12-11 11:03:40 -08:00
test_index.rs transaction: remove Drop implementation 2021-12-01 10:31:35 -08:00
test_init.rs transaction: remove Drop implementation 2021-12-01 10:31:35 -08:00
test_load_repo.rs workspace: move search for .jj/ directory from Repo to Workspace 2021-11-25 21:08:43 -08:00
test_merge_trees.rs testutils: make init_repo return a struct, including a Workspace 2021-11-25 21:04:56 -08:00
test_mut_repo.rs repo: add a convenience function for rebasing all descendants 2022-01-27 08:28:44 -08:00
test_operations.rs testutils: make init_repo return a struct, including a Workspace 2021-11-25 21:04:56 -08:00
test_refs.rs testutils: make init_repo return a struct, including a Workspace 2021-11-25 21:04:56 -08:00
test_revset_graph_iterator.rs testutils: make init_repo return a struct, including a Workspace 2021-11-25 21:04:56 -08:00
test_revset.rs revsets: add author() and committer() functions (#46) 2021-12-15 22:50:29 -08:00
test_rewrite.rs rewrite: fix auto-rebasing after "branchy" rewrites 2022-01-27 22:20:14 -08:00
test_view.rs testutils: make init_repo return a struct, including a Workspace 2021-11-25 21:04:56 -08:00
test_working_copy_concurrent.rs working_copy: keep track of operation ID (#13) 2022-01-19 19:15:29 -08:00
test_working_copy.rs working_copy: keep track of operation ID (#13) 2022-01-19 19:15:29 -08:00
test_workspace.rs workspace: move search for .jj/ directory from Repo to Workspace 2021-11-25 21:08:43 -08:00