jj/lib/tests
Martin von Zweigbergk cea6061f3d conflicts: add a function for parsing a materialized conflict
I initially made the working copy materialize conflicts in its
`check_out()` method. Then I changed it later (exactly a year ago, on
Halloween of 2020, actually) so that the working copy expected
conflicts to already have been materalized, which happens in
`MutableRepo::check_out`().

I think my reasoning then was that the file system cannot represent a
conflict. While it's true that the file system itself doesn't have
information to know whether a file represents a conflict, we can
record that ourselves. We already record whether a file is executable
or not and then preserve that if we're on a file system that isn't
able to record it. It's not that different to do the same for
conflicts if we're on a file system that doesn't understand conflicts
(i.e. all file systems).

The plan is to have the working copy remember whether a file
represents a conflict. When we check if it has changed, we parse the
file, including conflict markers, and recreate the conflict from
it. We should be able to do that losslessly (and we should adjust
formats to make it possible if we find cases where it's not).

Having the working copy preserve conflict states has several
advantages:

 * Because conflicts are not materialized in the working copy, you can
   rebase the conflicted commit and the working copy without causing
   more conflicts (that's currently a UX bug I run into every now and
   then).

 * If you don't change anything in the working copy, it will be
   unchanged compared to its parent, which means we'll automatically
   abandon it if you update away from it.

 * The user can choose to resolve only some of the conflicts in a file
   and squash those in, and it'll work they way you'd hope.

 * It should make it easier to implement support for external merge
   tools (#18) without having them treat the working copy differently.

This patch prepares for that work by adding support for parsing
materialized conflicts.
2021-11-07 15:17:51 -08: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 evolution: don't create pruned commits (#32) 2021-10-06 23:20:23 -07:00
test_commit_concurrent.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_conflicts.rs conflicts: add a function for parsing a materialized conflict 2021-11-07 15:17:51 -08:00
test_diff_summary.rs store: rename Store to Backend and StoreWrapper to Store 2021-09-12 12:02:10 -07:00
test_git.rs git: don't update public heads for now 2021-10-20 14:23:58 -07:00
test_index.rs MutableRepo: accept just CommitId instead of whole Commit where possible 2021-09-29 10:13:32 -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 MutableRepo: accept just CommitId instead of whole Commit where possible 2021-09-29 10:13:32 -07:00
test_merge_trees.rs trees: try to resolve file conflicts after simplifying conflicts 2021-10-22 09:20:50 -07:00
test_mut_repo.rs view: don't force commits pointed to by refs to be current heads 2021-10-23 09:15:05 -07:00
test_operations.rs evolution: delete it now that we don't use it anymore (#32) 2021-10-06 23:28:30 -07:00
test_refs.rs tests: use CommitGraphBuilder in test_refs.rs 2021-08-18 09:58:44 -07:00
test_revset_graph_iterator.rs revset graph: make order of edges stable 2021-10-23 20:33:59 -07:00
test_revset.rs view: don't force commits pointed to by refs to be current heads 2021-10-23 09:15:05 -07:00
test_rewrite.rs view: don't force commits pointed to by refs to be current heads 2021-10-23 09:15:05 -07:00
test_view.rs tests: update a test to not point a branch to an unreachable commit 2021-10-02 23:08:45 -07:00
test_working_copy_concurrent.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