aboutsummaryrefslogtreecommitdiffstats
path: root/subversion/libsvn_diff/diff_tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'subversion/libsvn_diff/diff_tree.c')
-rw-r--r--subversion/libsvn_diff/diff_tree.c75
1 files changed, 14 insertions, 61 deletions
diff --git a/subversion/libsvn_diff/diff_tree.c b/subversion/libsvn_diff/diff_tree.c
index 8490179c48e7..d18b242c6343 100644
--- a/subversion/libsvn_diff/diff_tree.c
+++ b/subversion/libsvn_diff/diff_tree.c
@@ -37,14 +37,6 @@
#include "private/svn_diff_tree.h"
#include "svn_private_config.h"
-typedef struct tree_processor_t
-{
- svn_diff_tree_processor_t tp;
-
- /* void *future_extension */
-} tree_processor_t;
-
-
static svn_error_t *
default_dir_opened(void **new_dir_baton,
svn_boolean_t *skip,
@@ -215,33 +207,30 @@ svn_diff_tree_processor_t *
svn_diff__tree_processor_create(void *baton,
apr_pool_t *result_pool)
{
- tree_processor_t *wrapper;
- wrapper = apr_pcalloc(result_pool, sizeof(*wrapper));
-
- wrapper->tp.baton = baton;
+ svn_diff_tree_processor_t *tp = apr_pcalloc(result_pool, sizeof(*tp));
- wrapper->tp.dir_opened = default_dir_opened;
- wrapper->tp.dir_added = default_dir_added;
- wrapper->tp.dir_deleted = default_dir_deleted;
- wrapper->tp.dir_changed = default_dir_changed;
- wrapper->tp.dir_closed = default_dir_closed;
+ tp->baton = baton;
- wrapper->tp.file_opened = default_file_opened;
- wrapper->tp.file_added = default_file_added;
- wrapper->tp.file_deleted = default_file_deleted;
- wrapper->tp.file_changed = default_file_changed;
- wrapper->tp.file_closed = default_file_closed;
+ tp->dir_opened = default_dir_opened;
+ tp->dir_added = default_dir_added;
+ tp->dir_deleted = default_dir_deleted;
+ tp->dir_changed = default_dir_changed;
+ tp->dir_closed = default_dir_closed;
- wrapper->tp.node_absent = default_node_absent;
+ tp->file_opened = default_file_opened;
+ tp->file_added = default_file_added;
+ tp->file_deleted = default_file_deleted;
+ tp->file_changed = default_file_changed;
+ tp->file_closed = default_file_closed;
+ tp->node_absent = default_node_absent;
- return &wrapper->tp;
+ return tp;
}
struct reverse_tree_baton_t
{
const svn_diff_tree_processor_t *processor;
- const char *prefix_relpath;
};
static svn_error_t *
@@ -259,9 +248,6 @@ reverse_dir_opened(void **new_dir_baton,
{
struct reverse_tree_baton_t *rb = processor->baton;
- if (rb->prefix_relpath)
- relpath = svn_relpath_join(rb->prefix_relpath, relpath, scratch_pool);
-
SVN_ERR(rb->processor->dir_opened(new_dir_baton, skip, skip_children,
relpath,
right_source, left_source,
@@ -284,9 +270,6 @@ reverse_dir_added(const char *relpath,
{
struct reverse_tree_baton_t *rb = processor->baton;
- if (rb->prefix_relpath)
- relpath = svn_relpath_join(rb->prefix_relpath, relpath, scratch_pool);
-
SVN_ERR(rb->processor->dir_deleted(relpath,
right_source,
right_props,
@@ -307,9 +290,6 @@ reverse_dir_deleted(const char *relpath,
{
struct reverse_tree_baton_t *rb = processor->baton;
- if (rb->prefix_relpath)
- relpath = svn_relpath_join(rb->prefix_relpath, relpath, scratch_pool);
-
SVN_ERR(rb->processor->dir_added(relpath,
NULL,
left_source,
@@ -335,9 +315,6 @@ reverse_dir_changed(const char *relpath,
struct reverse_tree_baton_t *rb = processor->baton;
apr_array_header_t *reversed_prop_changes = NULL;
- if (rb->prefix_relpath)
- relpath = svn_relpath_join(rb->prefix_relpath, relpath, scratch_pool);
-
if (prop_changes)
{
SVN_ERR_ASSERT(left_props != NULL && right_props != NULL);
@@ -367,9 +344,6 @@ reverse_dir_closed(const char *relpath,
{
struct reverse_tree_baton_t *rb = processor->baton;
- if (rb->prefix_relpath)
- relpath = svn_relpath_join(rb->prefix_relpath, relpath, scratch_pool);
-
SVN_ERR(rb->processor->dir_closed(relpath,
right_source,
left_source,
@@ -393,9 +367,6 @@ reverse_file_opened(void **new_file_baton,
{
struct reverse_tree_baton_t *rb = processor->baton;
- if (rb->prefix_relpath)
- relpath = svn_relpath_join(rb->prefix_relpath, relpath, scratch_pool);
-
SVN_ERR(rb->processor->file_opened(new_file_baton,
skip,
relpath,
@@ -423,9 +394,6 @@ reverse_file_added(const char *relpath,
{
struct reverse_tree_baton_t *rb = processor->baton;
- if (rb->prefix_relpath)
- relpath = svn_relpath_join(rb->prefix_relpath, relpath, scratch_pool);
-
SVN_ERR(rb->processor->file_deleted(relpath,
right_source,
right_file,
@@ -447,9 +415,6 @@ reverse_file_deleted(const char *relpath,
{
struct reverse_tree_baton_t *rb = processor->baton;
- if (rb->prefix_relpath)
- relpath = svn_relpath_join(rb->prefix_relpath, relpath, scratch_pool);
-
SVN_ERR(rb->processor->file_added(relpath,
NULL /* copyfrom src */,
left_source,
@@ -480,9 +445,6 @@ reverse_file_changed(const char *relpath,
struct reverse_tree_baton_t *rb = processor->baton;
apr_array_header_t *reversed_prop_changes = NULL;
- if (rb->prefix_relpath)
- relpath = svn_relpath_join(rb->prefix_relpath, relpath, scratch_pool);
-
if (prop_changes)
{
SVN_ERR_ASSERT(left_props != NULL && right_props != NULL);
@@ -515,9 +477,6 @@ reverse_file_closed(const char *relpath,
{
struct reverse_tree_baton_t *rb = processor->baton;
- if (rb->prefix_relpath)
- relpath = svn_relpath_join(rb->prefix_relpath, relpath, scratch_pool);
-
SVN_ERR(rb->processor->file_closed(relpath,
right_source,
left_source,
@@ -536,9 +495,6 @@ reverse_node_absent(const char *relpath,
{
struct reverse_tree_baton_t *rb = processor->baton;
- if (rb->prefix_relpath)
- relpath = svn_relpath_join(rb->prefix_relpath, relpath, scratch_pool);
-
SVN_ERR(rb->processor->node_absent(relpath,
dir_baton,
rb->processor,
@@ -549,7 +505,6 @@ reverse_node_absent(const char *relpath,
const svn_diff_tree_processor_t *
svn_diff__tree_processor_reverse_create(const svn_diff_tree_processor_t * processor,
- const char *prefix_relpath,
apr_pool_t *result_pool)
{
struct reverse_tree_baton_t *rb;
@@ -557,8 +512,6 @@ svn_diff__tree_processor_reverse_create(const svn_diff_tree_processor_t * proces
rb = apr_pcalloc(result_pool, sizeof(*rb));
rb->processor = processor;
- if (prefix_relpath)
- rb->prefix_relpath = apr_pstrdup(result_pool, prefix_relpath);
reverse = svn_diff__tree_processor_create(rb, result_pool);