You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2015/10/22 11:20:03 UTC

svn commit: r1709967 - in /subversion/branches/move-tracking-2/subversion: include/private/svn_editor3e.h libsvn_delta/compat3e.c libsvn_delta/migrate.c svnmover/svnmover.c svnmover/svnmover.h

Author: julianfoad
Date: Thu Oct 22 09:20:03 2015
New Revision: 1709967

URL: http://svn.apache.org/viewvc?rev=1709967&view=rev
Log:
On the 'move-tracking-2' branch: Remove the use of a now redundant
'in-memory editor' in the svnmover WC code.

This continues the refactoring to use branch txn/state objects instead of
a single 'editor'.

* subversion/include/private/svn_editor3e.h
  (svn_editor3_in_memory): Delete.
  (svn_branch_get_migration_editor): Take a 'txn' instead of an 'editor'.

* subversion/libsvn_delta/compat3e.c
  (editor3_mem_complete,
   editor3_mem_abort,
   svn_editor3_in_memory): Delete.

* subversion/libsvn_delta/migrate.c
  (edit_baton,
   svn_branch_get_migration_editor): Take a 'txn' instead of an 'editor'.
    (At present there is no implementation here to use it, either way.)

* subversion/svnmover/svnmover.c
  (wc_checkout): Don't initialize an 'editor'.
  (do_switch,
   do_commit,
   final_commit): Use txn->sequence_point() instead of editor->complete().
  (migrate_replay_rev_started,
   do_migrate): Pass a 'txn' instead of an 'editor'.

* subversion/svnmover/svnmover.h
  (svnmover_wc_t): Remove the 'editor' field.

Modified:
    subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h
    subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c
    subversion/branches/move-tracking-2/subversion/libsvn_delta/migrate.c
    subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
    subversion/branches/move-tracking-2/subversion/svnmover/svnmover.h

Modified: subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h?rev=1709967&r1=1709966&r2=1709967&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/private/svn_editor3e.h Thu Oct 22 09:20:03 2015
@@ -1225,21 +1225,12 @@ svn_editor3__delta_from_ev3_for_update(
                         apr_pool_t *result_pool,
                         apr_pool_t *scratch_pool);
 
-/* Get an editor for editing branches of BRANCHING_TXN in memory.
- */
-svn_error_t *
-svn_editor3_in_memory(svn_editor3_t **editor_p,
-                      svn_branch_txn_t *branching_txn,
-                      svn_editor3__shim_fetch_func_t fetch_func,
-                      void *fetch_baton,
-                      apr_pool_t *result_pool);
-
 /* An Ev1 editor that drives (heuristically) a move-tracking editor.
  */
 svn_error_t *
 svn_branch_get_migration_editor(const svn_delta_editor_t **old_editor,
                                 void **old_edit_baton,
-                                svn_editor3_t *new_editor,
+                                svn_branch_txn_t *edit_txn,
                                 svn_ra_session_t *from_session,
                                 svn_revnum_t revision,
                                 apr_pool_t *result_pool);

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c?rev=1709967&r1=1709966&r2=1709967&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3e.c Thu Oct 22 09:20:03 2015
@@ -1864,24 +1864,6 @@ editor3_abort(void *baton,
   return SVN_NO_ERROR;
 }
 
-/* An #svn_editor3_t method. */
-static svn_error_t *
-editor3_mem_complete(void *baton,
-                     apr_pool_t *scratch_pool)
-{
-  SVN_ERR(editor3_sequence_point(baton, scratch_pool));
-
-  return SVN_NO_ERROR;
-}
-
-/* An #svn_editor3_t method. */
-static svn_error_t *
-editor3_mem_abort(void *baton,
-                  apr_pool_t *scratch_pool)
-{
-  return SVN_NO_ERROR;
-}
-
 /* Baton for wrap_fetch_func. */
 typedef struct wrap_fetch_baton_t
 {
@@ -1927,41 +1909,6 @@ wrap_fetch_func(svn_node_kind_t *kind,
 
   return SVN_NO_ERROR;
 }
-
-svn_error_t *
-svn_editor3_in_memory(svn_editor3_t **editor_p,
-                      svn_branch_txn_t *branching_txn,
-                      svn_editor3__shim_fetch_func_t fetch_func,
-                      void *fetch_baton,
-                      apr_pool_t *result_pool)
-{
-  static const svn_editor3_cb_funcs_t editor_funcs = {
-    editor3_new_eid,
-    editor3_open_branch,
-    editor3_branch,
-    editor3_alter,
-    editor3_copy_one,
-    editor3_copy_tree,
-    editor3_delete,
-    editor3_sequence_point,
-    editor3_mem_complete,
-    editor3_mem_abort
-  };
-  ev3_from_delta_baton_t *eb = apr_pcalloc(result_pool, sizeof(*eb));
-  wrap_fetch_baton_t *wb = apr_pcalloc(result_pool, sizeof(*wb));
-
-  *editor_p = svn_editor3_create(&editor_funcs, eb,
-                                 NULL, NULL /*cancel*/, result_pool);
-
-  eb->txn = branching_txn;
-
-  wb->fetch_func = fetch_func;
-  wb->fetch_baton = fetch_baton;
-  eb->fetch_func = wrap_fetch_func;
-  eb->fetch_baton = wb;
-
-  return SVN_NO_ERROR;
-}
 
 svn_error_t *
 svn_editor3__ev3_from_delta_for_commit(

Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/migrate.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/migrate.c?rev=1709967&r1=1709966&r2=1709967&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/migrate.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/migrate.c Thu Oct 22 09:20:03 2015
@@ -29,7 +29,7 @@
 
 struct edit_baton
 {
-  svn_editor3_t *new_editor;
+  svn_branch_txn_t *edit_txn;
   svn_ra_session_t *from_session;
   svn_revnum_t revision;
 };
@@ -323,7 +323,7 @@ abort_edit(void *edit_baton,
 svn_error_t *
 svn_branch_get_migration_editor(const svn_delta_editor_t **old_editor,
                                 void **old_edit_baton,
-                                svn_editor3_t *new_editor,
+                                svn_branch_txn_t *edit_txn,
                                 svn_ra_session_t *from_session,
                                 svn_revnum_t revision,
                                 apr_pool_t *result_pool)
@@ -348,7 +348,7 @@ svn_branch_get_migration_editor(const sv
   };
   struct edit_baton *eb = apr_palloc(result_pool, sizeof(*eb));
 
-  eb->new_editor = new_editor;
+  eb->edit_txn = edit_txn;
   eb->from_session = from_session;
   eb->revision = revision;
 

Modified: subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c?rev=1709967&r1=1709966&r2=1709967&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c (original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c Thu Oct 22 09:20:03 2015
@@ -214,11 +214,6 @@ wc_checkout(svnmover_wc_t *wc,
                                       scratch_pool);
   SVN_ERR_ASSERT(wc->working->branch);
 
-  SVN_ERR(svn_editor3_in_memory(&wc->editor,
-                                wc->edit_txn,
-                                fetch_func, fetch_baton,
-                                wc->pool));
-
   return SVN_NO_ERROR;
 }
 
@@ -1809,7 +1804,7 @@ do_switch(svnmover_wc_t *wc,
     }
 
   /* Complete the old edit drive into the 'WC' txn */
-  SVN_ERR(svn_editor3_complete(wc->editor));
+  SVN_ERR(svn_branch_txn_sequence_point(wc->edit_txn, scratch_pool));
 
   /* Check out a new WC, re-using the same data object */
   SVN_ERR(wc_checkout(wc, revision, target_branch_id, scratch_pool));
@@ -2841,7 +2836,7 @@ do_commit(svn_revnum_t *new_rev_p,
   svn_revnum_t new_rev;
 
   /* Complete the old edit drive (into the 'WC') */
-  SVN_ERR(svn_editor3_complete(wc->editor));
+  SVN_ERR(svn_branch_txn_sequence_point(wc->edit_txn, scratch_pool));
 
   /* Commit */
   SVN_ERR(wc_commit(&new_rev, wc, revprops, scratch_pool));
@@ -2874,7 +2869,7 @@ do_revert(svnmover_wc_t *wc,
 
 /* Migration replay baton */
 typedef struct migrate_replay_baton_t {
-  svn_editor3_t *new_editor;
+  svn_branch_txn_t *edit_txn;
   svn_ra_session_t *from_session;
   /* Hash (by revnum) of array of svn_repos_move_info_t. */
   apr_hash_t *moves;
@@ -2898,7 +2893,7 @@ migrate_replay_rev_started(svn_revnum_t
   printf("DBG: migrate: start r%ld\n", revision);
 
   SVN_ERR(svn_branch_get_migration_editor(&old_editor, &old_edit_baton,
-                                          rb->new_editor,
+                                          rb->edit_txn,
                                           rb->from_session, revision,
                                           pool));
   SVN_ERR(svn_delta__get_debug_editor(&old_editor, &old_edit_baton,
@@ -2979,7 +2974,7 @@ do_migrate(svnmover_wc_t *wc,
                                       start_revision, end_revision,
                                       wc->ctx, scratch_pool, scratch_pool));
 
-  rb->new_editor = wc->editor;
+  rb->edit_txn = wc->edit_txn;
   rb->from_session = wc->ra_session;
   SVN_ERR(svn_ra_replay_range(rb->from_session,
                               start_revision, end_revision,
@@ -3553,7 +3548,7 @@ final_commit(svnmover_wc_t *wc,
   svn_error_t *err;
 
   /* Complete the old edit drive (into the 'WC') */
-  SVN_ERR(svn_editor3_complete(wc->editor));
+  SVN_ERR(svn_branch_txn_sequence_point(wc->edit_txn, scratch_pool));
 
   /* Commit, if there are any changes */
   err = wc_commit(NULL, wc, revprops, scratch_pool);

Modified: subversion/branches/move-tracking-2/subversion/svnmover/svnmover.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svnmover/svnmover.h?rev=1709967&r1=1709966&r2=1709967&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.h (original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.h Thu Oct 22 09:20:03 2015
@@ -53,7 +53,6 @@ typedef struct svnmover_wc_t
   svn_revnum_t head_revision;
 
   svn_ra_session_t *ra_session;
-  svn_editor3_t *editor;
   svn_branch_txn_t *edit_txn;
 
   /* Base and working versions. */