Commit Graph

9 Commits

Author SHA1 Message Date
Sean McGivern 3f71c43e88 Allow setting content for resolutions
When reading conflicts:

1. Add a `type` field. `text` works as before, and has `sections`;
   `text-editor` is a file with ambiguous conflict markers that can only
   be resolved in an editor.
2. Add a `content_path` field pointing to a JSON representation of the
   file's content for a single file.
3. Hitting `content_path` returns a similar datastructure to the `file`,
   but without the `content_path` and `sections` fields, and with a
   `content` field containing the full contents of the file (with
   conflict markers).

When writing conflicts:

1. Instead of `sections` being at the top level, they are now in a
   `files` array. This matches the read format better.
2. The `files` array contains file hashes, each of which must contain:
   a. `new_path`
   b. `old_path`
   c. EITHER `sections` (which works as before) or `content` (with the
      full content of the resolved file).
2016-10-13 14:16:34 -05:00
Sean McGivern 24424d932f Fix merge conflict size limit 2016-09-07 16:00:26 +01:00
Sean McGivern 44eb3197a9 Handle non-UTF-8 conflicts gracefully
These can't be resolved in the UI because if they aren't in a UTF-8
compatible encoding, they can't be rendered as JSON. Even if they could,
we would be implicitly changing the file encoding anyway, which seems
like a bad idea.
2016-08-25 08:27:08 +01:00
Sean McGivern 261d47bce9 Fix specs
- Add match line header to expected result for `File#sections`.
- Lowercase CSS colours.
- Remove unused `diff_refs` keyword argument.
- Rename `parent` -> `parent_file`, to be more explicit.
- Skip an iteration when highlighting.
2016-08-12 23:24:46 +03:00
Sean McGivern 18398152fa Raise errors for large and binary files 2016-08-12 23:24:44 +03:00
Sean McGivern f2f844693e Handle conflict resolution errors in controller 2016-08-12 23:24:44 +03:00
Sean McGivern 7af277f683 Auto-highlight conflict when rich_text is called 2016-08-12 23:24:43 +03:00
Sean McGivern a1c7961217 Handle multiple merge conflict files in collection 2016-08-12 23:24:43 +03:00
Sean McGivern df2ed097b7 Add backend for merge conflicts reading 2016-08-12 23:24:43 +03:00