You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ar...@apache.org on 2010/09/20 11:55:40 UTC

svn commit: r998859 - /subversion/trunk/subversion/svnrdump/dump_editor.c

Author: artagnon
Date: Mon Sep 20 09:55:40 2010
New Revision: 998859

URL: http://svn.apache.org/viewvc?rev=998859&view=rev
Log:
* subversion/svnrdump/dump_editor.c
  (): Add an LDR_DBG macro to output debugging information using
  SVN_DBG. This is the same macro we've used in load_editor.c.

  (open_root, delete_entry, add_directory, open_directory,
  close_directory, add_file, open_file, change_dir_prop,
  change_file_prop, apply_textdelta, close_file, close_edit): Use the
  LDR_DBG macro to print some useful information everytime these
  callbacks are fired.

Modified:
    subversion/trunk/subversion/svnrdump/dump_editor.c

Modified: subversion/trunk/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/dump_editor.c?rev=998859&r1=998858&r2=998859&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/dump_editor.c (original)
+++ subversion/trunk/subversion/svnrdump/dump_editor.c Mon Sep 20 09:55:40 2010
@@ -33,6 +33,12 @@
 
 #define ARE_VALID_COPY_ARGS(p,r) ((p) && SVN_IS_VALID_REVNUM(r))
 
+#ifdef SVN_DEBUG
+#define LDR_DBG(x) SVN_DBG(x)
+#else
+#define LDR_DBG(x) while(0)
+#endif
+
 /* The baton used by the dump editor. */
 struct dump_edit_baton {
   /* The output stream we write the dumpfile to */
@@ -315,6 +321,8 @@ open_root(void *edit_baton,
   struct dump_edit_baton *eb = edit_baton;
   /* Allocate a special pool for the edit_baton to avoid pool
      lifetime issues */
+
+  LDR_DBG(("open_root\n"));
   eb->pool = svn_pool_create(pool);
   eb->props = apr_hash_make(eb->pool);
   eb->deleted_props = apr_hash_make(eb->pool);
@@ -334,6 +342,8 @@ delete_entry(const char *path,
   struct dir_baton *pb = parent_baton;
   const char *mypath = apr_pstrdup(pool, path);
 
+  LDR_DBG(("delete_entry %s\n", path));
+
   /* Some pending properties to dump? */
   SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
 
@@ -358,6 +368,8 @@ add_directory(const char *path,
     = make_dir_baton(path, copyfrom_path, copyfrom_rev, pb->eb, pb, TRUE, pool);
   svn_boolean_t is_copy;
 
+  LDR_DBG(("add_directory %s\n", path));
+
   /* Some pending properties to dump? */
   SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
 
@@ -398,6 +410,8 @@ open_directory(const char *path,
   const char *copyfrom_path = NULL;
   svn_revnum_t copyfrom_rev = SVN_INVALID_REVNUM;
 
+  LDR_DBG(("open_directory %s\n", path));
+
   /* Some pending properties to dump? */
   SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
 
@@ -426,6 +440,8 @@ close_directory(void *dir_baton,
   apr_hash_index_t *hi;
   apr_pool_t *iterpool = svn_pool_create(pool);
 
+  LDR_DBG(("close_directory %p\n", dir_baton));
+
   /* Some pending properties to dump? */
   SVN_ERR(dump_props(eb, &(eb->dump_props_pending), TRUE, pool));
 
@@ -460,6 +476,8 @@ add_file(const char *path,
   void *val;
   svn_boolean_t is_copy;
 
+  LDR_DBG(("add_file %s\n", path));
+
   /* Some pending properties to dump? */
   SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
 
@@ -500,6 +518,8 @@ open_file(const char *path,
   const char *copyfrom_path = NULL;
   svn_revnum_t copyfrom_rev = SVN_INVALID_REVNUM;
 
+  LDR_DBG(("open_file %s\n", path));
+
   /* Some pending properties to dump? */
   SVN_ERR(dump_props(pb->eb, &(pb->eb->dump_props_pending), TRUE, pool));
 
@@ -530,6 +550,8 @@ change_dir_prop(void *parent_baton,
 {
   struct dir_baton *db = parent_baton;
 
+  LDR_DBG(("change_dir_prop %p\n", parent_baton));
+
   if (svn_property_kind(NULL, name) != svn_prop_regular_kind)
     return SVN_NO_ERROR;
 
@@ -566,6 +588,8 @@ change_file_prop(void *file_baton,
 {
   struct dump_edit_baton *eb = file_baton;
 
+  LDR_DBG(("change_file_prop %p\n", file_baton));
+
   if (svn_property_kind(NULL, name) != svn_prop_regular_kind)
     return SVN_NO_ERROR;
 
@@ -614,6 +638,8 @@ apply_textdelta(void *file_baton, const 
 {
   struct dump_edit_baton *eb = file_baton;
 
+  LDR_DBG(("apply_textdelta %p\n", file_baton));
+
   /* Custom handler_baton allocated in a separate pool */
   apr_pool_t *handler_pool = svn_pool_create(pool);
   struct handler_baton *hb = apr_pcalloc(handler_pool, sizeof(*hb));
@@ -650,6 +676,8 @@ close_file(void *file_baton,
   svn_stream_t *delta_filestream;
   apr_finfo_t *info = apr_pcalloc(pool, sizeof(apr_finfo_t));
 
+  LDR_DBG(("close_file %p\n", file_baton));
+
   /* Some pending properties to dump? */
   SVN_ERR(dump_props(eb, &(eb->dump_props_pending), FALSE, pool));
 
@@ -737,6 +765,7 @@ static svn_error_t *
 close_edit(void *edit_baton, apr_pool_t *pool)
 {
   struct dump_edit_baton *eb = edit_baton;
+  LDR_DBG(("close_edit\n"));
   svn_pool_destroy(eb->pool);
 
   return SVN_NO_ERROR;