You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/04/15 16:31:28 UTC

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

Author: hwright
Date: Fri Apr 15 14:31:27 2011
New Revision: 1092721

URL: http://svn.apache.org/viewvc?rev=1092721&view=rev
Log:
Remove a header file by folding some of the declarations into the file
in which they are used, and others into the svnrdump-wide header file.
Rename the public function to match our naming standards.

* subversion/svnrdump/svnrdump.c
  (replay_revisions): Update caller.

* subversion/svnrdump/dump_editor.h:
  Remove.

* subversion/svnrdump/svnrdump.h
  (svn_rdump__get_dump_editor): New.

* subversion/svnrdump/dump_editor.c
  (dir_baton, handler_baton): Copied here from dump_editor.h.
  (svn_rdump__get_dump_editor): Renamed from get_dump_editor().

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

Modified: subversion/trunk/subversion/svnrdump/dump_editor.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/dump_editor.c?rev=1092721&r1=1092720&r2=1092721&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/dump_editor.c (original)
+++ subversion/trunk/subversion/svnrdump/dump_editor.c Fri Apr 15 14:31:27 2011
@@ -32,8 +32,6 @@
 
 #include "private/svn_fspath.h"
 
-#include "dump_editor.h"
-
 #include "svnrdump.h"
 
 #define ARE_VALID_COPY_ARGS(p,r) ((p) && SVN_IS_VALID_REVNUM(r))
@@ -44,6 +42,40 @@
 #define LDR_DBG(x) while(0)
 #endif
 
+/* A directory baton used by all directory-related callback functions
+ * in the dump editor.  */
+struct dir_baton
+{
+  struct dump_edit_baton *eb;
+  struct dir_baton *parent_dir_baton;
+
+  /* is this directory a new addition to this revision? */
+  svn_boolean_t added;
+
+  /* has this directory been written to the output stream? */
+  svn_boolean_t written_out;
+
+  /* the absolute path to this directory */
+  const char *abspath; /* an fspath */
+
+  /* Copyfrom info for the node, if any. */
+  const char *copyfrom_path; /* a relpath */
+  svn_revnum_t copyfrom_rev;
+
+  /* Hash of paths that need to be deleted, though some -might- be
+     replaced.  Maps const char * paths to this dir_baton. Note that
+     they're full paths, because that's what the editor driver gives
+     us, although they're all really within this directory. */
+  apr_hash_t *deleted_entries;
+};
+
+/* A handler baton to be used in window_handler().  */
+struct handler_baton
+{
+  svn_txdelta_window_handler_t apply_handler;
+  void *apply_baton;
+};
+
 /* The baton used by the dump editor. */
 struct dump_edit_baton {
   /* The output stream we write the dumpfile to */
@@ -814,12 +846,12 @@ close_edit(void *edit_baton, apr_pool_t 
 }
 
 svn_error_t *
-get_dump_editor(const svn_delta_editor_t **editor,
-                void **edit_baton,
-                svn_stream_t *stream,
-                svn_cancel_func_t cancel_func,
-                void *cancel_baton,
-                apr_pool_t *pool)
+svn_rdump__get_dump_editor(const svn_delta_editor_t **editor,
+                           void **edit_baton,
+                           svn_stream_t *stream,
+                           svn_cancel_func_t cancel_func,
+                           void *cancel_baton,
+                           apr_pool_t *pool)
 {
   struct dump_edit_baton *eb;
   svn_delta_editor_t *de;

Modified: subversion/trunk/subversion/svnrdump/svnrdump.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/svnrdump.c?rev=1092721&r1=1092720&r2=1092721&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/svnrdump.c (original)
+++ subversion/trunk/subversion/svnrdump/svnrdump.c Fri Apr 15 14:31:27 2011
@@ -36,7 +36,6 @@
 #include "svn_string.h"
 #include "svn_props.h"
 
-#include "dump_editor.h"
 #include "load_editor.h"
 #include "svnrdump.h"
 
@@ -350,8 +349,8 @@ replay_revisions(svn_ra_session_t *sessi
 
   SVN_ERR(svn_stream_for_stdout(&stdout_stream, pool));
 
-  SVN_ERR(get_dump_editor(&dump_editor, &dump_baton, stdout_stream,
-                          check_cancel, NULL, pool));
+  SVN_ERR(svn_rdump__get_dump_editor(&dump_editor, &dump_baton, stdout_stream,
+                                     check_cancel, NULL, pool));
 
   replay_baton = apr_pcalloc(pool, sizeof(*replay_baton));
   replay_baton->editor = dump_editor;

Modified: subversion/trunk/subversion/svnrdump/svnrdump.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svnrdump/svnrdump.h?rev=1092721&r1=1092720&r2=1092721&view=diff
==============================================================================
--- subversion/trunk/subversion/svnrdump/svnrdump.h (original)
+++ subversion/trunk/subversion/svnrdump/svnrdump.h Fri Apr 15 14:31:27 2011
@@ -29,12 +29,28 @@
 #include "svn_error.h"
 #include "svn_pools.h"
 #include "svn_hash.h"
+#include "svn_delta.h"
 
 #ifdef __cplusplus
 extern "C" {
 #endif /* __cplusplus */
 
 
+/**
+ * Get a dump editor @a editor along with a @a edit_baton allocated in
+ * @a pool.  The editor will write output to @a stream.  Use @a
+ * cancel_func and @a cancel_baton to check for user cancellation of
+ * the operation (for timely-but-safe termination).
+ */
+svn_error_t *
+svn_rdump__get_dump_editor(const svn_delta_editor_t **editor,
+                           void **edit_baton,
+                           svn_stream_t *stream,
+                           svn_cancel_func_t cancel_func,
+                           void *cancel_baton,
+                           apr_pool_t *pool);
+
+
 /* Normalize the line ending style of the values of properties in PROPS
  * that "need translation" (according to svn_prop_needs_translation(),
  * currently all svn:* props) so that they contain only LF (\n) line endings.