Author: rhuijben
Date: Tue May 10 12:34:43 2011
New Revision: 1101432

URL: http://svn.apache.org/viewvc?rev=1101432&view=rev
Log:
[Patch 2/3. See r1101428 and the next commit for more details]

Remove the copyfrom support from the merge api and directly pass a set of
actual properties to allow most of the merge processing to happen without
looking at DB.

* subversion/libsvn_wc/externals.c
  (close_file): Update caller.

* subversion/libsvn_wc/update_editor.c
  (svn_wc__perform_file_merge): Add actual_props argument. Remove obsolete
    comment. Update caller.
  (close_file): Update caller.

* subversion/libsvn_wc/wc.h
  (svn_wc__internal_merge): Update arguments and documentation.

Modified:
    subversion/trunk/subversion/libsvn_wc/externals.c
    subversion/trunk/subversion/libsvn_wc/update_editor.c
    subversion/trunk/subversion/libsvn_wc/wc.h

Modified: subversion/trunk/subversion/libsvn_wc/externals.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/externals.c?rev=1101432&r1=1101431&r2=1101432&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/externals.c (original)
+++ subversion/trunk/subversion/libsvn_wc/externals.c Tue May 10 12:34:43 2011
@@ -759,6 +759,7 @@ close_file(void *file_baton,
                                                    eb->wri_abspath,
                                                    new_checksum,
                                                    original_checksum,
+                                                   actual_props,
                                                    eb->ext_patterns,
                                                    eb->original_revision,
                                                    *eb->target_revision,

Modified: subversion/trunk/subversion/libsvn_wc/update_editor.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/update_editor.c?rev=1101432&r1=1101431&r2=1101432&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/update_editor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/update_editor.c Tue May 10 12:34:43 
2011
@@ -3214,6 +3214,7 @@ svn_wc__perform_file_merge(svn_skel_t **
                            const char *wri_abspath,
                            const svn_checksum_t *new_checksum,
                            const svn_checksum_t *original_checksum,
+                           apr_hash_t *actual_props,
                            const apr_array_header_t *ext_patterns,
                            svn_revnum_t old_revision,
                            svn_revnum_t target_revision,
@@ -3287,19 +3288,15 @@ svn_wc__perform_file_merge(svn_skel_t **
      textbase into the file we're updating.
      Remember that this function wants full paths! */
   /* ### TODO: Pass version info here. */
-  /* ### NOTE: if this call bails out, then we must ensure
-     ###   that no work items have been queued which might
-     ###   place this file into an inconsistent state.
-     ###   in the future, all the state changes should be
-     ###   made atomically.  */
   SVN_ERR(svn_wc__internal_merge(&work_item,
                                  merge_outcome,
                                  db,
                                  merge_left, NULL,
                                  new_text_base_tmp_abspath, NULL,
                                  local_abspath,
-                                 NULL /* copyfrom_abspath */,
+                                 wri_abspath,
                                  oldrev_str, newrev_str, mine_str,
+                                 actual_props,
                                  FALSE /* dry_run */,
                                  diff3_cmd, NULL, propchanges,
                                  conflict_func, conflict_baton,
@@ -3348,6 +3345,7 @@ merge_file(svn_skel_t **work_items,
            const char **install_from,
            svn_wc_notify_state_t *content_state,
            struct file_baton *fb,
+           apr_hash_t *actual_props,
            apr_time_t last_changed_date,
            apr_pool_t *result_pool,
            apr_pool_t *scratch_pool)
@@ -3452,6 +3450,7 @@ merge_file(svn_skel_t **work_items,
                                          fb->add_existed
                                                   ? NULL
                                                   : fb->original_checksum,
+                                         actual_props,
                                          eb->ext_patterns,
                                          fb->old_revision,
                                          *eb->target_revision,
@@ -3477,7 +3476,8 @@ merge_file(svn_skel_t **work_items,
       SVN_ERR(svn_wc__get_translate_info(NULL, NULL,
                                          &keywords,
                                          NULL,
-                                         eb->db, fb->local_abspath, NULL,
+                                         eb->db, fb->local_abspath,
+                                         actual_props, TRUE,
                                          scratch_pool, scratch_pool));
       if (magic_props_changed || keywords)
         {
@@ -3808,8 +3808,8 @@ close_file(void *file_baton,
       if (!fb->obstruction_found)
         {
           SVN_ERR(merge_file(&work_item, &install_pristine, &install_from,
-                             &content_state, fb, new_changed_date,
-                             scratch_pool, scratch_pool));
+                             &content_state, fb, current_actual_props,
+                             new_changed_date, scratch_pool, scratch_pool));
 
           all_work_items = svn_wc__wq_merge(all_work_items, work_item,
                                             scratch_pool);

Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=1101432&r1=1101431&r2=1101432&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Tue May 10 12:34:43 2011
@@ -409,12 +409,6 @@ svn_wc__internal_file_modified_p(svn_boo
    properties, which could affect the way the wc target is
    detranslated and compared with LEFT and RIGHT for merging.
 
-   If COPYFROM_ABSPATH is not NULL, the "local mods" text should be
-   taken from the path named there instead of from TARGET_ABSPATH
-   (but the merge should still be installed into TARGET_ABSPATH).
-   The merge target is allowed to not be under version control in
-   this case.
-
    The merge result is stored in *MERGE_OUTCOME and merge conflicts
    are marked in MERGE_RESULT using LEFT_LABEL, RIGHT_LABEL and
    TARGET_LABEL.
@@ -437,6 +431,12 @@ svn_wc__internal_file_modified_p(svn_boo
    ## TODO: We should store the information in LEFT_VERSION and RIGHT_VERSION
             in the workingcopy for future retrieval via svn info.
 
+   WRI_ABSPATH describes in which working copy information should be
+   retrieved. (Interesting for merging file externals).
+
+   ACTUAL_PROPS is the set of actual properties before merging; used for
+   detranslating the file before merging.
+
    Property changes sent by the update are provided in PROP_DIFF.
 
    For a complete description, see svn_wc_merge3() for which this is
@@ -454,10 +454,11 @@ svn_wc__internal_merge(svn_skel_t **work
                        const char *right_abspath,
                        const svn_wc_conflict_version_t *right_version,
                        const char *target_abspath,
-                       const char *copyfrom_abspath,
+                       const char *wri_abspath,
                        const char *left_label,
                        const char *right_label,
                        const char *target_label,
+                       apr_hash_t *actual_props,
                        svn_boolean_t dry_run,
                        const char *diff3_cmd,
                        const apr_array_header_t *merge_options,
@@ -734,8 +735,8 @@ svn_wc__write_check(svn_wc__db_t *db,
 
 /* Perform the actual merge of file changes between an original file,
    identified by ORIGINAL_CHECKSUM (an empty file if NULL) to a new file
-   identified by NEW_CHECKSUM.
-   
+   identified by NEW_CHECKSUM in the working copy identified by WRI_ABSPATH.
+
    Merge the result into LOCAL_ABSPATH, which is part of the working copy
    identified by WRI_ABSPATH. Use OLD_REVISION and TARGET_REVISION for naming
    the intermediate files.
@@ -750,6 +751,7 @@ svn_wc__perform_file_merge(svn_skel_t **
                            const char *wri_abspath,
                            const svn_checksum_t *new_checksum,
                            const svn_checksum_t *original_checksum,
+                           apr_hash_t *actual_props,
                            const apr_array_header_t *ext_patterns,
                            svn_revnum_t old_revision,
                            svn_revnum_t target_revision,
@@ -760,7 +762,8 @@ svn_wc__perform_file_merge(svn_skel_t **
                            svn_cancel_func_t cancel_func,
                            void *cancel_baton,
                            apr_pool_t *result_pool,
-                           apr_pool_t *scratch_pool);
+                           apr_pool_t *scratch_pool)
+;
 
 #ifdef __cplusplus
 }


Reply via email to