You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2010/07/22 13:50:02 UTC

svn commit: r966595 - in /subversion/trunk/subversion/svnrdump: dump_editor.c svnrdump.h util.c

Author: stsp
Date: Thu Jul 22 11:50:02 2010
New Revision: 966595

URL: http://svn.apache.org/viewvc?rev=966595&view=rev
Log:
Move an svnrdump helper function from svnrdump/util.c to
svnrdump/dump_editor.c, because it's only used there.

* subversion/svnrdump/dump_editor.c
  (dump_props): Moved here from util.c. Make it a static function.
   Docstring was tweaked, and also fix indentation of an if-statement
   to conform to our coding style.

* subversion/svnrdump/util.c
  (dump_props): Moved to dump_editor.c.

* subversion/svnrdump/svnrdump.h
  (dump_props): Undeclare.

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

Modified: subversion/trunk/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/dump_editor.c?rev=966595&r1=966594&r2=966595&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/dump_editor.c (original)
+++ subversion/trunk/subversion/svnrdump/dump_editor.c Thu Jul 22 11:50:02 2010
@@ -85,6 +85,61 @@ make_dir_baton(const char *path,
 
   return new_db;
 }
+
+/* Extract and dump the properties and del_properties stored in the
+ * edit baton EB, using POOL for any temporary allocations. If
+ * TRIGGER_VAR is not NULL, it is set to FALSE.
+ * Unless DUMP_DATA_TOO is set, only property headers are dumped.
+ */
+static svn_error_t *
+dump_props(struct dump_edit_baton *eb,
+           svn_boolean_t *trigger_var,
+           svn_boolean_t dump_data_too,
+           apr_pool_t *pool)
+{
+  svn_stream_t *propstream;
+
+  if (trigger_var && !*trigger_var)
+    return SVN_NO_ERROR;
+
+  svn_stringbuf_setempty(eb->propstring);
+  propstream = svn_stream_from_stringbuf(eb->propstring, eb->pool);
+  SVN_ERR(svn_hash_write_incremental(eb->properties, eb->del_properties,
+                                     propstream, "PROPS-END", pool));
+  SVN_ERR(svn_stream_close(propstream));
+  
+  /* Prop-delta: true */
+  SVN_ERR(svn_stream_printf(eb->stream, pool,
+          SVN_REPOS_DUMPFILE_PROP_DELTA
+          ": true\n"));
+
+  /* Prop-content-length: 193 */
+  SVN_ERR(svn_stream_printf(eb->stream, pool,
+          SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH
+          ": %" APR_SIZE_T_FMT "\n", eb->propstring->len));
+
+  if (dump_data_too)
+    {
+      /* Content-length: 14 */
+      SVN_ERR(svn_stream_printf(eb->stream, pool,
+              SVN_REPOS_DUMPFILE_CONTENT_LENGTH
+              ": %" APR_SIZE_T_FMT "\n\n",
+              eb->propstring->len));
+
+      /* The properties. */
+      SVN_ERR(svn_stream_write(eb->stream, eb->propstring->data,
+             &(eb->propstring->len)));
+
+      /* Cleanup so that data is never dumped twice. */
+      svn_hash__clear(eb->properties, pool);
+      svn_hash__clear(eb->del_properties, pool);
+      if (trigger_var)
+        *trigger_var = FALSE;
+    }
+
+  return SVN_NO_ERROR;
+}
+
 /*
  * Write out a node record for PATH of type KIND under EB->FS_ROOT.
  * ACTION describes what is happening to the node (see enum

Modified: subversion/trunk/subversion/svnrdump/svnrdump.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/svnrdump.h?rev=966595&r1=966594&r2=966595&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/svnrdump.h (original)
+++ subversion/trunk/subversion/svnrdump/svnrdump.h Thu Jul 22 11:50:02 2010
@@ -35,18 +35,4 @@ struct replay_baton {
   svn_boolean_t verbose;
 };
 
-/**
- * Dump revision properties, and (optionally) full text.
- *
- * Extract and dump the properties and del_properties stored in the
- * edit baton @a eb using @a pool for any temporary allocations. If
- * @a trigger_var is passed, it is unset. Unless @a dump_data_too is
- * set, only property headers are dumped.
- */
-svn_error_t *
-dump_props(struct dump_edit_baton *eb,
-           svn_boolean_t *trigger_var,
-           svn_boolean_t dump_data_too,
-           apr_pool_t *pool);
-
 #endif

Modified: subversion/trunk/subversion/svnrdump/util.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/util.c?rev=966595&r1=966594&r2=966595&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/util.c (original)
+++ subversion/trunk/subversion/svnrdump/util.c Thu Jul 22 11:50:02 2010
@@ -25,50 +25,3 @@
 #include "svn_hash.h"
 
 #include "svnrdump.h"
-
-svn_error_t *
-dump_props(struct dump_edit_baton *eb,
-           svn_boolean_t *trigger_var,
-           svn_boolean_t dump_data_too,
-           apr_pool_t *pool)
-{
-  svn_stream_t *propstream;
-
-  if (trigger_var && !*trigger_var)
-    return SVN_NO_ERROR;
-
-  svn_stringbuf_setempty(eb->propstring);
-  propstream = svn_stream_from_stringbuf(eb->propstring, eb->pool);
-  SVN_ERR(svn_hash_write_incremental(eb->properties, eb->del_properties,
-                                     propstream, "PROPS-END", pool));
-  SVN_ERR(svn_stream_close(propstream));
-  
-  /* Prop-delta: true */
-  SVN_ERR(svn_stream_printf(eb->stream, pool,
-          SVN_REPOS_DUMPFILE_PROP_DELTA
-          ": true\n"));
-
-  /* Prop-content-length: 193 */
-  SVN_ERR(svn_stream_printf(eb->stream, pool,
-          SVN_REPOS_DUMPFILE_PROP_CONTENT_LENGTH
-          ": %" APR_SIZE_T_FMT "\n", eb->propstring->len));
-
-  if (dump_data_too) {
-    /* Content-length: 14 */
-    SVN_ERR(svn_stream_printf(eb->stream, pool,
-            SVN_REPOS_DUMPFILE_CONTENT_LENGTH
-            ": %" APR_SIZE_T_FMT "\n\n",
-            eb->propstring->len));
-
-    /* The properties. */
-    SVN_ERR(svn_stream_write(eb->stream, eb->propstring->data,
-           &(eb->propstring->len)));
-
-    /* Cleanup so that data is never dumped twice. */
-    svn_hash__clear(eb->properties, pool);
-    svn_hash__clear(eb->del_properties, pool);
-    if (trigger_var)
-      *trigger_var = FALSE;
-  }
-  return SVN_NO_ERROR;
-}