Mark many merge tests as skip-against-old-server.
[svn.git] / subversion / libsvn_delta / compat.c
blobf65042d255cf461a8e314d67ffe9159dad290b13
1 /*
2 * compat.c : Wrappers and callbacks for compatibility.
4 * ====================================================================
5 * Copyright (c) 2007 CollabNet. All rights reserved.
7 * This software is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at http://subversion.tigris.org/license-1.html.
10 * If newer versions of this license are posted there, you may use a
11 * newer version instead, at your option.
13 * This software consists of voluntary contributions made by many
14 * individuals. For exact contribution history, see the revision
15 * history and logs, available at http://subversion.tigris.org/.
16 * ====================================================================
19 #include <apr_pools.h>
21 #include "svn_types.h"
22 #include "svn_error.h"
23 #include "svn_delta.h"
26 struct file_rev_handler_wrapper_baton {
27 void *baton;
28 svn_file_rev_handler_old_t handler;
31 /* This implements svn_repos_file_rev_handler2_t. */
32 static svn_error_t *
33 file_rev_handler_wrapper(void *baton,
34 const char *path,
35 svn_revnum_t rev,
36 apr_hash_t *rev_props,
37 svn_boolean_t result_of_merge,
38 svn_txdelta_window_handler_t *delta_handler,
39 void **delta_baton,
40 apr_array_header_t *prop_diffs,
41 apr_pool_t *pool)
43 struct file_rev_handler_wrapper_baton *fwb = baton;
45 if (fwb->handler)
46 return fwb->handler(fwb->baton,
47 path,
48 rev,
49 rev_props,
50 delta_handler,
51 delta_baton,
52 prop_diffs,
53 pool);
55 return SVN_NO_ERROR;
58 void
59 svn_compat_wrap_file_rev_handler(svn_file_rev_handler_t *handler2,
60 void **handler2_baton,
61 svn_file_rev_handler_old_t handler,
62 void *handler_baton,
63 apr_pool_t *pool)
65 struct file_rev_handler_wrapper_baton *fwb = apr_palloc(pool, sizeof(*fwb));
67 /* Set the user provided old format callback in the baton. */
68 fwb->baton = handler_baton;
69 fwb->handler = handler;
71 *handler2_baton = fwb;
72 *handler2 = file_rev_handler_wrapper;