ok/jj
1
0
Fork 0
forked from mirrors/jj
jj/tests
Martin von Zweigbergk f70e6987b5 conflicts: preserve order of adds in materialized conflict
We write conflict to the working copy by materializing them as
conflict markers in a file. When the file has been modified (or just
the mtime has changed), we parse the markers to reconstruct the
conflict. For example, let's say we see this conflict marker:

```
<<<<<<<
+++++++
b
%%%%%%%
-a
+c
>>>>>>>
```

Then we will create a hunk with ["a"] as removed and ["b", "c"] as
added.

Now, since commit b84be06c08, when we materialize conflicts, we
minimize the diff part of the marker (the `%%%%%%%` part). The problem
is that that minimization may result in a different order of the
positive conflict terms. That's particularly bad because we do the
minimization per hunk, so we can end up reconstructing an input that
never existed.

This commit fixes the bug by only considering the next add and the one
after that, and emitting either only the first with `%%%%%%%`, or both
of them, with the first one in `++++++++` and the second one in
`%%%%%%%`.

Note that the recent fix to add context to modify/delete conflicts
means that when we parse modified such conflicts, we'll always
consider them resolved, since the expected adds/removes we pass will
not match what's actually in the file. That doesn't seem so bad, and
it's not obvious what the fix should be, so I'll leave that for later.
2023-02-18 22:01:25 -08:00
..
common tests: pass string instead of bytes to add_config() 2023-01-26 12:48:30 -08:00
test_abandon_command.rs cli: switch default graph style to be Sapling's curved style 2023-02-12 07:23:29 -08:00
test_alias.rs templater: use reverse-alphabet hex for change ids 2023-02-13 22:49:21 -08:00
test_branch_command.rs cli: switch default graph style to be Sapling's curved style 2023-02-12 07:23:29 -08:00
test_cat_command.rs cli: rename print to cat 2023-01-18 10:10:02 -08:00
test_checkout.rs cli: switch default graph style to be Sapling's curved style 2023-02-12 07:23:29 -08:00
test_commit_command.rs cli: switch default graph style to be Sapling's curved style 2023-02-12 07:23:29 -08:00
test_commit_template.rs config: remove ui.unique-prefixes/log-id-preferred-length in favor of alias 2023-02-16 11:43:17 +09:00
test_concurrent_operations.rs Make ui.relative-timestamps default to true 2023-02-15 21:26:14 -08:00
test_config_command.rs Don't output implicit defaults from "config list" 2023-02-01 19:49:57 -06:00
test_debug_command.rs Add "jj debug config-schema" command to output JSON schema 2023-01-03 22:02:25 -06:00
test_describe_command.rs tests: pass string instead of bytes to add_config() 2023-01-26 12:48:30 -08:00
test_diff_command.rs templater: do not complete "(no commit description)" by default 2023-02-01 16:13:43 +09:00
test_diffedit_command.rs tests: make fake editor scripts initially empty 2023-01-25 21:58:38 -08:00
test_duplicate_command.rs cli: switch default graph style to be Sapling's curved style 2023-02-12 07:23:29 -08:00
test_edit_command.rs cli: switch default graph style to be Sapling's curved style 2023-02-12 07:23:29 -08:00
test_git_clone.rs cli: on clone, turn local git remote to absolute path 2022-12-07 14:14:31 +09:00
test_git_colocated.rs templater: use reverse-alphabet hex for change ids 2023-02-13 22:49:21 -08:00
test_git_fetch.rs git fetch: prune old branch names before adding new ones 2023-02-12 02:10:17 +01:00
test_git_import_export.rs git: add git.auto-local-branch 2023-01-29 20:17:49 -08:00
test_git_push.rs cli: use reverse-alphabet hex for branch name in jj git push --change 2023-02-13 22:49:21 -08:00
test_git_remotes.rs copyright: change from "Google LLC" to "The Jujutsu Authors" 2022-11-28 06:05:45 -10:00
test_gitignores.rs copyright: change from "Google LLC" to "The Jujutsu Authors" 2022-11-28 06:05:45 -10:00
test_global_opts.rs cli: switch default graph style to be Sapling's curved style 2023-02-12 07:23:29 -08:00
test_init_command.rs templater: use reverse-alphabet hex for change ids 2023-02-13 22:49:21 -08:00
test_interdiff_command.rs copyright: change from "Google LLC" to "The Jujutsu Authors" 2022-11-28 06:05:45 -10:00
test_log_command.rs config: remove ui.log-author-format in favor of template alias 2023-02-16 11:43:17 +09:00
test_move_command.rs cli: switch default graph style to be Sapling's curved style 2023-02-12 07:23:29 -08:00
test_new_command.rs cli: switch default graph style to be Sapling's curved style 2023-02-12 07:23:29 -08:00
test_obslog_command.rs conflicts: replace missing files by empty in materialized conflict 2023-02-17 22:19:04 -08:00
test_operations.rs Rename ui.relative-timestamps to ui.oplog-relative-timestamps 2023-02-15 21:26:14 -08:00
test_rebase_command.rs cli: switch default graph style to be Sapling's curved style 2023-02-12 07:23:29 -08:00
test_resolve_command.rs conflicts: preserve order of adds in materialized conflict 2023-02-18 22:01:25 -08:00
test_restore_command.rs cmd: Remove the -i option to jj restore. 2022-12-21 08:15:06 -08:00
test_revset_output.rs templater: use reverse-alphabet hex for change ids 2023-02-13 22:49:21 -08:00
test_show_command.rs config: migrate log/show timestamp format away from config knob 2023-02-16 11:43:17 +09:00
test_sparse_command.rs copyright: change from "Google LLC" to "The Jujutsu Authors" 2022-11-28 06:05:45 -10:00
test_split_command.rs templater: use reverse-alphabet hex for change ids 2023-02-13 22:49:21 -08:00
test_squash_command.rs cli: switch default graph style to be Sapling's curved style 2023-02-12 07:23:29 -08:00
test_status_command.rs cli: append "\n" to commit description specified by -m/--message 2022-12-22 14:59:03 +09:00
test_templater.rs templater: save alias chain to report type/name error in original context 2023-02-14 10:06:28 +09:00
test_undo.rs cli: switch default graph style to be Sapling's curved style 2023-02-12 07:23:29 -08:00
test_unsquash_command.rs cli: switch default graph style to be Sapling's curved style 2023-02-12 07:23:29 -08:00
test_untrack_command.rs tests: pass string instead of bytes to add_config() 2023-01-26 12:48:30 -08:00
test_workspaces.rs config: rename [template] section to [templates], drop .graph suffix 2023-02-15 00:23:48 +09:00