Log Message: |
Fix a spurious 'incoming edit' tree conflict with an unmodified file.
If a file is added and then merged between branches but never actually
modified otherwise, the server would report two versions of this file as
changed, even though the only actual difference is a filesystem copy ID.
This resulted in open_file() and apply_textdelta() calls, with an empty
text delta, being sent to the client during a merge.
If the file was not present in the merge target working copy (i.e. deleted
in the target branch's history), the client would raise a spurious
'local missing vs incoming edit' tree conflict.
This conflict is spurious because the file was not actually edited.
The client assumes that an open_file() call by the server implies an edit
and uses this as a hint during tree conflict detection. So having the server
send no-op changes during a merge will result in unnecessary tree conflicts.
See the test case added in this commit for a reproduction recipe.
We can fix this problem by extending a check for 'relatedness' already
present in the server-side reporter: If two related files do not differ
in terms of properties or content, don't report a change to the client.
Previously, this logic only triggered for two files which represent
the exact same filesystem node ID (including the copy ID).
Note that this is a server-side fix. A client-side fix is probably harder
to implement in this case, but I'd be happy to be shown wrong on this.
* subversion/libsvn_repos/reporter.c
(update_entry): Do not report related files as changed if they don't
actually differ in terms of property or content changes.
* subversion/tests/cmdline/merge_tree_conflict_tests.py
(spurios_tree_conflict_with_added_file, test_list): New test.
|