jj/lib/tests
Martin von Zweigbergk ef4cb663ae cli: move logic for updating branches after rewrite to lib crate
This patch moves the function for updating branches after rewrite from
`commands.rs` into `rewrite.rs`.

It also changes the function to update branches even if they were
conflicted or become conflicted. I think that seems better than
leaving branches on old commits. For example, let's say you have start
with this:

```
C main
|
B origin@main
|
A
```

You now pull from origin, which has updated the main branch from B to
B'. We apply that change to both the remote branch and the local
branch, which results in a conflict in the local branch:

```
C main?
|
B B' main? origin@main
|/
A
```

If you now rewrite C to C', the conflicted main branch will still
point to C, which is just weird. This patch changes that so the
conflicted side of main gets repointed to C'.

I also refactored the code to reuse our existing
`MutableRepo::merge_single_ref()`, which improves the behavior in
several cases, such as the conflict-resolution case in the last test
case.
2021-09-18 10:03:26 -07:00
..
test_bad_locking.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_commit_builder.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_commit_concurrent.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_diff_summary.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_evolution.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_git.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_index.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_init.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_load_repo.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_merge_trees.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_mut_repo.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_operations.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_refs.rs tests: use CommitGraphBuilder in test_refs.rs 2021-08-18 09:58:44 -07:00
test_revset.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_revset_graph_iterator.rs cleanup: commit transactions in tests when it's simpler 2021-07-30 17:47:00 -07:00
test_rewrite.rs cli: move logic for updating branches after rewrite to lib crate 2021-09-18 10:03:26 -07:00
test_view.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_working_copy.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_working_copy_concurrent.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00