subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1438992 - in /subversion/trunk/subversion/libsvn_client: client.h diff.c merge.c repos_diff.c
Date Sat, 26 Jan 2013 23:33:47 GMT
Author: rhuijben
Date: Sat Jan 26 23:33:46 2013
New Revision: 1438992

URL: http://svn.apache.org/viewvc?rev=1438992&view=rev
Log:
Apply a temporary workaround to the repository diff wrapping to allow merge to
see absent paths without implementing the diff processor yet.

* subversion/libsvn_client/client.h
  (svn_client__get_diff_editor): Add hashtable argument.

* subversion/libsvn_client/diff.c
  (diff_repos_repos,
   diff_summarize_repos_repos): Update caller.

* subversion/libsvn_client/merge.c
  (drive_merge_report_editor): Update caller. Put absent nodes in the skipped
    abspaths list.

* subversion/libsvn_client/repos_diff.c
  (diff_notify_baton_t): Add variable.
  (diff_state_absent): Fix exact notification type.
  (svn_client__get_diff_editor): Update baton initialization.

Modified:
    subversion/trunk/subversion/libsvn_client/client.h
    subversion/trunk/subversion/libsvn_client/diff.c
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/libsvn_client/repos_diff.c

Modified: subversion/trunk/subversion/libsvn_client/client.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/client.h?rev=1438992&r1=1438991&r2=1438992&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/client.h (original)
+++ subversion/trunk/subversion/libsvn_client/client.h Sat Jan 26 23:33:46 2013
@@ -722,6 +722,9 @@ svn_client__get_inheritable_props(apr_ha
    If NOTIFY_FUNC is non-null, invoke it with NOTIFY_BATON for each
    file and directory operated on during the edit.
 
+   If ABSENT_RELPATHS is non-null, collect const char * keys in it with
+   the relative paths marked as absent by the diff driver.
+
    EDITOR/EDIT_BATON return the newly created editor and baton. */
 svn_error_t *
 svn_client__get_diff_editor(const svn_delta_editor_t **editor,
@@ -731,6 +734,7 @@ svn_client__get_diff_editor(const svn_de
                             svn_revnum_t revision,
                             svn_boolean_t walk_deleted_dirs,
                             svn_boolean_t text_deltas,
+                            apr_hash_t *absent_relpaths,
                             const svn_wc_diff_callbacks4_t *diff_callbacks,
                             void *diff_cmd_baton,
                             svn_cancel_func_t cancel_func,

Modified: subversion/trunk/subversion/libsvn_client/diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/diff.c?rev=1438992&r1=1438991&r2=1438992&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/diff.c Sat Jan 26 23:33:46 2013
@@ -2015,6 +2015,7 @@ diff_repos_repos(const svn_wc_diff_callb
                 depth,
                 extra_ra_session, rev1, TRUE /* walk_deleted_dirs */,
                 TRUE /* text_deltas */,
+                NULL /* absent relpaths */,
                 callbacks, callback_baton,
                 ctx->cancel_func, ctx->cancel_baton,
                 NULL /* no notify_func */, NULL /* no notify_baton */,
@@ -2701,6 +2702,7 @@ diff_summarize_repos_repos(svn_client_di
             depth,
             extra_ra_session, rev1, TRUE /* walk_deleted_dirs */,
             FALSE /* text_deltas */,
+            NULL /* absent relpaths */,
             callbacks, callback_baton,
             ctx->cancel_func, ctx->cancel_baton,
             NULL /* notify_func */, NULL /* notify_baton */, pool));

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1438992&r1=1438991&r2=1438992&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Sat Jan 26 23:33:46 2013
@@ -5130,6 +5130,7 @@ drive_merge_report_editor(const char *ta
   svn_boolean_t honor_mergeinfo = HONOR_MERGEINFO(merge_b);
   const char *old_sess1_url, *old_sess2_url;
   svn_boolean_t is_rollback = source->loc1->rev > source->loc2->rev;
+  apr_hash_t *absent_relpaths = apr_hash_make(scratch_pool);
 
   /* Start with a safe default starting revision for the editor and the
      merge target. */
@@ -5201,6 +5202,7 @@ drive_merge_report_editor(const char *ta
                                       merge_b->ra_session2, source->loc1->rev,
                                       FALSE /* walk_deleted_dirs */,
                                       TRUE /* text_deltas */,
+                                      absent_relpaths,
                                       &merge_callbacks, merge_b,
                                       merge_b->ctx->cancel_func,
                                       merge_b->ctx->cancel_baton,
@@ -5322,6 +5324,24 @@ drive_merge_report_editor(const char *ta
   /* Caller must call svn_sleep_for_timestamps() */
   *(merge_b->use_sleep) = TRUE;
 
+  if (apr_hash_count(absent_relpaths))
+    {
+      apr_hash_index_t *hi;
+
+      for (hi = apr_hash_first(scratch_pool, absent_relpaths);
+           hi;
+           hi = apr_hash_next(hi))
+        {
+          const char *absent_abspath;
+
+          absent_abspath = svn_dirent_join(target_abspath,
+                                           svn__apr_hash_index_key(hi),
+                                           merge_b->pool);
+
+          apr_hash_set(merge_b->skipped_abspaths, absent_abspath,
+                       APR_HASH_KEY_STRING, absent_abspath);
+        }
+    }
   return SVN_NO_ERROR;
 }
 

Modified: subversion/trunk/subversion/libsvn_client/repos_diff.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/repos_diff.c?rev=1438992&r1=1438991&r2=1438992&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/repos_diff.c Sat Jan 26 23:33:46 2013
@@ -1272,6 +1272,9 @@ struct diff_notify_baton_t
   svn_wc_notify_func2_t notify_func;
   void *notify_baton;
 
+  /* If not NULL collects the absent paths */
+  apr_hash_t *absent_relpaths;
+
   apr_pool_t *pool;
 };
 
@@ -1481,9 +1484,17 @@ diff_state_absent(const char *relpath,
         = svn_wc_create_notify(relpath, svn_wc_notify_skip, scratch_pool);
 
       notify->kind = svn_node_file;
+      notify->content_state = notify->prop_state
+        = svn_wc_notify_state_missing;
       (*dnb->notify_func)(dnb->notify_baton, notify, scratch_pool);
     }
 
+  if (dnb->absent_relpaths)
+    apr_hash_set(dnb->absent_relpaths,
+                 apr_pstrdup(apr_hash_pool_get(dnb->absent_relpaths), relpath),
+                 APR_HASH_KEY_STRING,
+                 "");
+
   return SVN_NO_ERROR;
 }
 
@@ -1496,6 +1507,7 @@ svn_client__get_diff_editor(const svn_de
                             svn_revnum_t revision,
                             svn_boolean_t walk_deleted_dirs,
                             svn_boolean_t text_deltas,
+                            apr_hash_t *absent_relpaths,
                             const svn_wc_diff_callbacks4_t *diff_callbacks,
                             void *diff_cmd_baton,
                             svn_cancel_func_t cancel_func,
@@ -1518,6 +1530,7 @@ svn_client__get_diff_editor(const svn_de
   dnb->deleted_paths = apr_hash_make(eb->pool);
   dnb->notify_func = notify_func;
   dnb->notify_baton = notify_baton;
+  dnb->absent_relpaths = absent_relpaths;
 
   SVN_ERR(svn_wc__wrap_diff_callbacks(&eb->processor,
                                       diff_callbacks, diff_cmd_baton,



Mime
View raw message