Author: rinrab
Date: Tue Sep 1 15:10:41 2026
New Revision: 1937729
Log:
Implement svn_diff__tree_processor_use_debug(): A helper to attach a debug tree
processor much easier.
* include/private/svn_diff_tree.h
(svn_diff__tree_processor_use_debug): Declare function.
* libsvn_diff/diff_tree_debug.c
(svn_diff__tree_processor_use_debug): Implement.
Modified:
subversion/trunk/subversion/include/private/svn_diff_tree.h
subversion/trunk/subversion/libsvn_diff/diff_tree_debug.c
Modified: subversion/trunk/subversion/include/private/svn_diff_tree.h
==============================================================================
--- subversion/trunk/subversion/include/private/svn_diff_tree.h Tue Sep 1
14:39:28 2026 (r1937728)
+++ subversion/trunk/subversion/include/private/svn_diff_tree.h Tue Sep 1
15:10:41 2026 (r1937729)
@@ -373,6 +373,17 @@ const svn_diff_tree_processor_t *
svn_diff__tree_processor_debug_create(svn_stream_t *out_stream,
apr_pool_t *result_pool);
+
+/* Attaches debug logging for stdout onto @a processor, wraping the tree
+ * processor into a new one that will also call the methods from the original
+ * vtable.
+ *
+ * This is essentially a helper for faster use of
+ * svn_diff__tree_processor_debug_create(). */
+svn_error_t *
+svn_diff__tree_processor_use_debug(const svn_diff_tree_processor_t **processor,
+ apr_pool_t *result_pool);
+
svn_diff_source_t *
svn_diff__source_create(svn_revnum_t revision,
apr_pool_t *result_pool);
Modified: subversion/trunk/subversion/libsvn_diff/diff_tree_debug.c
==============================================================================
--- subversion/trunk/subversion/libsvn_diff/diff_tree_debug.c Tue Sep 1
14:39:28 2026 (r1937728)
+++ subversion/trunk/subversion/libsvn_diff/diff_tree_debug.c Tue Sep 1
15:10:41 2026 (r1937729)
@@ -371,3 +371,19 @@ svn_diff__tree_processor_debug_create(sv
return debug;
}
+
+svn_error_t *
+svn_diff__tree_processor_use_debug(const svn_diff_tree_processor_t **processor,
+ apr_pool_t *result_pool)
+{
+ svn_stream_t *stdout_stream;
+ const svn_diff_tree_processor_t *debug;
+
+ SVN_ERR(svn_stream_for_stdout(&stdout_stream, result_pool));
+
+ debug = svn_diff__tree_processor_debug_create(stdout_stream, result_pool);
+
+ *processor = svn_diff__tree_processor_tee_create(*processor, debug,
+ result_pool);
+ return SVN_NO_ERROR;
+}