subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject svn commit: r1334150 - in /subversion/trunk: ./ subversion/libsvn_client/commit_util.c
Date Fri, 04 May 2012 20:07:06 GMT
Author: gstein
Date: Fri May  4 20:07:06 2012
New Revision: 1334150

URL: http://svn.apache.org/viewvc?rev=1334150&view=rev
Log:
Reintegrate / cherry-pick r1332738 from the ev2-export branch. It
tosses the internal commit debug Ev1 editor.

Modified:
    subversion/trunk/   (props changed)
    subversion/trunk/subversion/libsvn_client/commit_util.c

Propchange: subversion/trunk/
------------------------------------------------------------------------------
  Merged /subversion/branches/ev2-export:r1332738

Modified: subversion/trunk/subversion/libsvn_client/commit_util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/commit_util.c?rev=1334150&r1=1334149&r2=1334150&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/commit_util.c (original)
+++ subversion/trunk/subversion/libsvn_client/commit_util.c Fri May  4 20:07:06 2012
@@ -1750,17 +1750,6 @@ fixup_error:
                                             err, ctx, pool));
 }
 
-
-#ifdef SVN_CLIENT_COMMIT_DEBUG
-/* Prototype for function below */
-static svn_error_t *get_test_editor(const svn_delta_editor_t **editor,
-                                    void **edit_baton,
-                                    const svn_delta_editor_t *real_editor,
-                                    void *real_eb,
-                                    const char *base_url,
-                                    apr_pool_t *pool);
-#endif /* SVN_CLIENT_COMMIT_DEBUG */
-
 svn_error_t *
 svn_client__do_commit(const char *base_url,
                       const apr_array_header_t *commit_items,
@@ -1781,14 +1770,6 @@ svn_client__do_commit(const char *base_u
   apr_array_header_t *paths =
     apr_array_make(scratch_pool, commit_items->nelts, sizeof(const char *));
 
-#ifdef SVN_CLIENT_COMMIT_DEBUG
-  {
-    SVN_ERR(get_test_editor(&editor, &edit_baton,
-                            editor, edit_baton,
-                            base_url, scratch_pool));
-  }
-#endif /* SVN_CLIENT_COMMIT_DEBUG */
-
   /* Ditto for the checksums. */
   if (sha1_checksums)
     *sha1_checksums = apr_hash_make(result_pool);
@@ -1881,269 +1862,6 @@ svn_client__do_commit(const char *base_u
 }
 
 
-#ifdef SVN_CLIENT_COMMIT_DEBUG
-
-/*** Temporary test editor ***/
-
-struct edit_baton
-{
-  const char *path;
-
-  const svn_delta_editor_t *real_editor;
-  void *real_eb;
-};
-
-struct item_baton
-{
-  struct edit_baton *eb;
-  void *real_baton;
-
-  const char *path;
-};
-
-static struct item_baton *
-make_baton(struct edit_baton *eb,
-           void *real_baton,
-           const char *path,
-           apr_pool_t *pool)
-{
-  struct item_baton *new_baton = apr_pcalloc(pool, sizeof(*new_baton));
-  new_baton->eb = eb;
-  new_baton->real_baton = real_baton;
-  new_baton->path = apr_pstrdup(pool, path);
-  return new_baton;
-}
-
-static svn_error_t *
-set_target_revision(void *edit_baton,
-                    svn_revnum_t target_revision,
-                    apr_pool_t *pool)
-{
-  struct edit_baton *eb = edit_baton;
-  return (*eb->real_editor->set_target_revision)(eb->real_eb,
-                                                 target_revision,
-                                                 pool);
-}
-
-static svn_error_t *
-open_root(void *edit_baton,
-          svn_revnum_t base_revision,
-          apr_pool_t *dir_pool,
-          void **root_baton)
-{
-  struct edit_baton *eb = edit_baton;
-  struct item_baton *new_baton = make_baton(eb, NULL, eb->path, dir_pool);
-  fprintf(stderr, "TEST EDIT STARTED (base URL=%s)\n", eb->path);
-  *root_baton = new_baton;
-  return (*eb->real_editor->open_root)(eb->real_eb,
-                                       base_revision,
-                                       dir_pool,
-                                       &new_baton->real_baton);
-}
-
-static svn_error_t *
-add_file(const char *path,
-         void *parent_baton,
-         const char *copyfrom_path,
-         svn_revnum_t copyfrom_revision,
-         apr_pool_t *pool,
-         void **baton)
-{
-  struct item_baton *db = parent_baton;
-  struct item_baton *new_baton = make_baton(db->eb, NULL, path, pool);
-  const char *copystuffs = "";
-  if (copyfrom_path && SVN_IS_VALID_REVNUM(copyfrom_revision))
-    copystuffs = apr_psprintf(pool,
-                              " (copied from %s:%ld)",
-                              copyfrom_path,
-                              copyfrom_revision);
-  fprintf(stderr, "   Adding  : %s%s\n", path, copystuffs);
-  *baton = new_baton;
-  return (*db->eb->real_editor->add_file)(path, db->real_baton,
-                                          copyfrom_path, copyfrom_revision,
-                                          pool, &new_baton->real_baton);
-}
-
-static svn_error_t *
-delete_entry(const char *path,
-             svn_revnum_t revision,
-             void *parent_baton,
-             apr_pool_t *pool)
-{
-  struct item_baton *db = parent_baton;
-  fprintf(stderr, "   Deleting: %s\n", path);
-  return (*db->eb->real_editor->delete_entry)(path, revision,
-                                              db->real_baton, pool);
-}
-
-static svn_error_t *
-open_file(const char *path,
-          void *parent_baton,
-          svn_revnum_t base_revision,
-          apr_pool_t *pool,
-          void **baton)
-{
-  struct item_baton *db = parent_baton;
-  struct item_baton *new_baton = make_baton(db->eb, NULL, path, pool);
-  fprintf(stderr, "   Opening : %s\n", path);
-  *baton = new_baton;
-  return (*db->eb->real_editor->open_file)(path, db->real_baton,
-                                           base_revision, pool,
-                                           &new_baton->real_baton);
-}
-
-static svn_error_t *
-close_file(void *baton, const char *text_checksum, apr_pool_t *pool)
-{
-  struct item_baton *fb = baton;
-  fprintf(stderr, "   Closing : %s\n", fb->path);
-  return (*fb->eb->real_editor->close_file)(fb->real_baton,
-                                            text_checksum, pool);
-}
-
-
-static svn_error_t *
-change_file_prop(void *file_baton,
-                 const char *name,
-                 const svn_string_t *value,
-                 apr_pool_t *pool)
-{
-  struct item_baton *fb = file_baton;
-  fprintf(stderr, "      PropSet (%s=%s)\n", name, value ? value->data : "");
-  return (*fb->eb->real_editor->change_file_prop)(fb->real_baton,
-                                                  name, value, pool);
-}
-
-static svn_error_t *
-apply_textdelta(void *file_baton,
-                const char *base_checksum,
-                apr_pool_t *pool,
-                svn_txdelta_window_handler_t *handler,
-                void **handler_baton)
-{
-  struct item_baton *fb = file_baton;
-  fprintf(stderr, "      Transmitting text...\n");
-  return (*fb->eb->real_editor->apply_textdelta)(fb->real_baton,
-                                                 base_checksum, pool,
-                                                 handler, handler_baton);
-}
-
-static svn_error_t *
-close_edit(void *edit_baton, apr_pool_t *pool)
-{
-  struct edit_baton *eb = edit_baton;
-  fprintf(stderr, "TEST EDIT COMPLETED\n");
-  return (*eb->real_editor->close_edit)(eb->real_eb, pool);
-}
-
-static svn_error_t *
-add_directory(const char *path,
-              void *parent_baton,
-              const char *copyfrom_path,
-              svn_revnum_t copyfrom_revision,
-              apr_pool_t *pool,
-              void **baton)
-{
-  struct item_baton *db = parent_baton;
-  struct item_baton *new_baton = make_baton(db->eb, NULL, path, pool);
-  const char *copystuffs = "";
-  if (copyfrom_path && SVN_IS_VALID_REVNUM(copyfrom_revision))
-    copystuffs = apr_psprintf(pool,
-                              " (copied from %s:%ld)",
-                              copyfrom_path,
-                              copyfrom_revision);
-  fprintf(stderr, "   Adding  : %s%s\n", path, copystuffs);
-  *baton = new_baton;
-  return (*db->eb->real_editor->add_directory)(path,
-                                               db->real_baton,
-                                               copyfrom_path,
-                                               copyfrom_revision,
-                                               pool,
-                                               &new_baton->real_baton);
-}
-
-static svn_error_t *
-open_directory(const char *path,
-               void *parent_baton,
-               svn_revnum_t base_revision,
-               apr_pool_t *pool,
-               void **baton)
-{
-  struct item_baton *db = parent_baton;
-  struct item_baton *new_baton = make_baton(db->eb, NULL, path, pool);
-  fprintf(stderr, "   Opening : %s\n", path);
-  *baton = new_baton;
-  return (*db->eb->real_editor->open_directory)(path, db->real_baton,
-                                                base_revision, pool,
-                                                &new_baton->real_baton);
-}
-
-static svn_error_t *
-change_dir_prop(void *dir_baton,
-                const char *name,
-                const svn_string_t *value,
-                apr_pool_t *pool)
-{
-  struct item_baton *db = dir_baton;
-  fprintf(stderr, "      PropSet (%s=%s)\n", name, value ? value->data : "");
-  return (*db->eb->real_editor->change_dir_prop)(db->real_baton,
-                                                 name, value, pool);
-}
-
-static svn_error_t *
-close_directory(void *baton, apr_pool_t *pool)
-{
-  struct item_baton *db = baton;
-  fprintf(stderr, "   Closing : %s\n", db->path);
-  return (*db->eb->real_editor->close_directory)(db->real_baton, pool);
-}
-
-static svn_error_t *
-abort_edit(void *edit_baton, apr_pool_t *pool)
-{
-  struct edit_baton *eb = edit_baton;
-  fprintf(stderr, "TEST EDIT ABORTED\n");
-  return (*eb->real_editor->abort_edit)(eb->real_eb, pool);
-}
-
-static svn_error_t *
-get_test_editor(const svn_delta_editor_t **editor,
-                void **edit_baton,
-                const svn_delta_editor_t *real_editor,
-                void *real_eb,
-                const char *base_url,
-                apr_pool_t *pool)
-{
-  svn_delta_editor_t *ed = svn_delta_default_editor(pool);
-  struct edit_baton *eb = apr_pcalloc(pool, sizeof(*eb));
-
-  eb->path = apr_pstrdup(pool, base_url);
-  eb->real_editor = real_editor;
-  eb->real_eb = real_eb;
-
-  /* We don't implement absent_file() or absent_directory() in this
-     editor, because presumably commit would never send that. */
-  ed->set_target_revision = set_target_revision;
-  ed->open_root = open_root;
-  ed->add_directory = add_directory;
-  ed->open_directory = open_directory;
-  ed->close_directory = close_directory;
-  ed->add_file = add_file;
-  ed->open_file = open_file;
-  ed->close_file = close_file;
-  ed->delete_entry = delete_entry;
-  ed->apply_textdelta = apply_textdelta;
-  ed->change_dir_prop = change_dir_prop;
-  ed->change_file_prop = change_file_prop;
-  ed->close_edit = close_edit;
-  ed->abort_edit = abort_edit;
-
-  *editor = ed;
-  *edit_baton = eb;
-  return SVN_NO_ERROR;
-}
-#endif /* SVN_CLIENT_COMMIT_DEBUG */
-
 svn_error_t *
 svn_client__get_log_msg(const char **log_msg,
                         const char **tmp_file,



Mime
View raw message