Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In the trunk, at merge.c: Open the root directory baton for each oper…
…ation. After this change we should always have a parent directory opened, even if we are given NULL as the parent_dir_baton argument of merge_dir_opened() or when merge_file_opened() is invoked with NULL dir_baton. In these cases we will access a "virtual" directory baton of the whole operation from the global merge_cmd_baton. We'll detect which baton to use by evaluating ternary operator, that checks the directory baton for NULL, and returns the global one if so. This will lead the merge implementation to the state, where we are always having the parent directory "opened" and we have an ability to access their resources, even if it hasn't been opened. There are a lot of checks such `if (pdb)`, which might be removed then. I'll commit them separately to optimize the diff and keep the correct structure. Additionally, there was a hack in the do_file_merge() function, that was opening a parent directory using the open_dir_for_replace_single_file() function. Now we can just do the sequence of tree-processor's invocations, provided below: [[[ file_opened() file_deleted() file_opened() file_added() ]]] * subversion/libsvn_client/merge.c (merge_cmd_baton_t): Declare target_dir_baton field. (merge_file_opened, merge_dir_opened): Check the directory for NULL, and take it from merge_b->target_dir_baton if it is. (open_dir_for_replace_single_file): Remove this function, since it is no longer referenced. (do_file_merge): No longer open directory using open_dir_for_replace_single_file(), but rely to the recent changes. (do_merge): Initialize merge_cmd_baton.target_dir_baton with a new baton, created using the create_dir_baton() function. git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1922266 13f79535-47bb-0310-9956-ffa450edef68
- Loading branch information