Author: rinrab
Date: Sun Nov 24 14:10:54 2024
New Revision: 1922048

URL: http://svn.apache.org/viewvc?rev=1922048&view=rev
Log:
On the 'apply-processor' branch: split 'merge.c' file, factoring-out merge
apply processor implementation in 'merge_processor.c' file instead of being
mixed with merge.

In this commit, the functions related to the tree-processor will be moved into a
new file. Additionally, the functions from the new file should use another
baton, rather than merge.c, so they are going to get separated as well.

Note: after this commit, a lot tests will be failing! I am going to fix them
later in this branch. this happens because I am temporary disabling some
functionalities using preprocessor definitions, starting with 'TODO_...'.

The 'merge_processor.c' file is actually an SVN-copy of merge.c. Most of its
content was removed from the copied one, but the moved part is going to be
removed from the original file. I am doing it in order preserve the history and
to insure that there are no explicitly made changes. In the 'merge_processor.c'
file, we only keep the tree-processor implementation. The changes are explained
below in details.

1. The following set of functions had been moved into merge_processor.c:

* check_repos_match()
* files_same_p()
* filter_self_referential_mergeinfo()
* handle_pending_notifications()
* make_conflict_versions()
* mark_dir_edited()
* mark_file_edited()
* merge_dir_added()
* merge_dir_changed()
* merge_dir_closed()
* merge_dir_deleted()
* merge_dir_opened()
* merge_file_added()
* merge_file_changed()
* merge_file_deleted()
* merge_file_opened()
* merge_node_absent()
* omit_mergeinfo_changes()
* open_dir_for_replace_single_file()
* prepare_merge_props_changed()
* properties_same_p()
* record_skip()
* record_tree_conflict()
* record_update_add()
* record_update_delete()
* record_update_update()
* split_mergeinfo_on_revision()
* verify_touched_by_del_check()

2. However, we are keeping the following functions in both files, since they
are being utilized from both parts of merge. I am adding 'TODO' comments in
front of these functions, reminding us to deduplicate them later:

* perform_obstruction_check()
* store_path()


* subversion/libsvn_client/client.h
  (svn_client__apply_processor_create): Declare function.
* subversion/libsvn_client/merge.c
  [1]: Moved to merge_processor.c.
  (merge_cmd_baton_t): Cleanup some field.
  (do_file_merge): Disable replace handling with TODO_REPLACE_SINGLE_FILE for 
now...
  (do_merge ext_patterns): Initialize using local variable instead of baton 
field.
  (do_merge merge_cmd_baton): Remove some field.
  (do_merge): Use svn_client__apply_processor_create instead of 
merge_apply_processor
   to create the tree-processor. Also do it for each merge source instead of
   reusing it many times.
* subversion/libsvn_client/merge_processor.c: Copied from 'merge.c'.
  [1],
  [2]: Move from merge.c.
  (svn_client__apply_processor_create): Implement function (this replaces 
merge_apply_processor())
  (TODO_STORE_PATH): add `#if` over store-path functionality. This code is
   utilized for notification, but we don't have access some resources yet.
  (TODO_USE_SLEEP): Add `#if` to temporary disable use_sleep, this is not
   implemented yet as well.
  (TODO_FILTER_MERGEINFO): Disable mergeinfo filtering, since we don't have
   the ra-sessions in the apply-processor.

PS: too much changes in a single commit, but the most of them are simple
removals.

Added:
    
subversion/branches/apply-processor/subversion/libsvn_client/merge_processor.c
      - copied, changed from r1922042, 
subversion/branches/apply-processor/subversion/libsvn_client/merge.c
Modified:
    subversion/branches/apply-processor/subversion/libsvn_client/client.h
    subversion/branches/apply-processor/subversion/libsvn_client/merge.c

Modified: subversion/branches/apply-processor/subversion/libsvn_client/client.h
URL: 
http://svn.apache.org/viewvc/subversion/branches/apply-processor/subversion/libsvn_client/client.h?rev=1922048&r1=1922047&r2=1922048&view=diff
==============================================================================
--- subversion/branches/apply-processor/subversion/libsvn_client/client.h 
(original)
+++ subversion/branches/apply-processor/subversion/libsvn_client/client.h Sun 
Nov 24 14:10:54 2024
@@ -1280,6 +1280,24 @@ svn_client__textbase_sync(svn_ra_session
 const svn_version_t *
 svn_client__compatible_wc_version_optional_pristine(apr_pool_t *result_pool);
 
+/* Return a diff processor that will apply the merge to the WC.
+ */
+svn_diff_tree_processor_t *
+svn_client__apply_processor_create(const svn_client__merge_target_t *target,
+                                   const svn_client__merge_source_t *source,
+                                   svn_wc_notify_func2_t notify_func,
+                                   void *notify_baton,
+                                   svn_boolean_t same_repos,
+                                   svn_boolean_t force_delete,
+                                   svn_boolean_t record_only,
+                                   svn_boolean_t dry_run,
+                                   const char *diff3_cmd,
+                                   const apr_array_header_t *merge_options,
+                                   const apr_array_header_t *ext_patterns,
+                                   svn_client_ctx_t *ctx,
+                                   apr_pool_t *scratch_pool,
+                                   apr_pool_t *result_pool);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */


Reply via email to