Using editable_working_tree for not only update but also for revert and checkout should allow us to re-use conflict detection and resolution machinery. For now this page lists some things about the different types of conflicts that can occur and how we'll deal with them.

Issues

*are these all done? I think they might be.. -- DC *

create_file_node/create_dir_node

attach_node

detach_node

drop_detached_node

apply_delta

Todo

These are far from a complete solution but they should at least prevent update failing and leaving the workspace in an inconsistent state with files detached and left in _MTN/tmp

The editable_working_tree interface currently cannot create detached files in _MTN/tmp/ because it currently relys on the filename to determine line endings and encodings and file names are not known until attach time. We should probably move encoding/line-ending information into attrs in the roster so they are available when filenames are not.

Next Steps

eg, for update, the full set of rosters involved looks like this:

B
|\
| \
|  \
T   W
 \  |\
  \ | \
   \|  \
    U   W+
     \  |
      \ |
       \|
        U+

In the first pass, collision detection says that if there are any conflicts in U+, it's an error and we can't perform the update (or pluck, etc). Otherwise, we can, and we apply B->T to W to create U, and write that out.

Later, once we have a nice UI and agreed way to write out conflicts from a roster into a workspace for the user to resolve, these conflicts can be written out too. For example, this would allow both a newly added file in T and the unversioned blocker file in W+ to be written out as a conflict for the user to resolve.

Blue Sky

It would be nice to eventually allow for automated conflict resolovers. For example when updating wants to add a file that is blocked by an existing unversioned file we could:

It seems like we may eventually want a filesystem interface that can be plugged into editable_working_tree so we can run against a mock implementation first and then again against the true implementation.

Affected Commands

The following commands should all eventually use the editable_working_tree interface so that they can all use the common conflict resolution machinery once that exists.