svn_client_mtcc.h

Go to the documentation of this file.
00001 /**
00002  * @copyright
00003  * ====================================================================
00004  *    Licensed to the Apache Software Foundation (ASF) under one
00005  *    or more contributor license agreements.  See the NOTICE file
00006  *    distributed with this work for additional information
00007  *    regarding copyright ownership.  The ASF licenses this file
00008  *    to you under the Apache License, Version 2.0 (the
00009  *    "License"); you may not use this file except in compliance
00010  *    with the License.  You may obtain a copy of the License at
00011  *
00012  *      http://www.apache.org/licenses/LICENSE-2.0
00013  *
00014  *    Unless required by applicable law or agreed to in writing,
00015  *    software distributed under the License is distributed on an
00016  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
00017  *    KIND, either express or implied.  See the License for the
00018  *    specific language governing permissions and limitations
00019  *    under the License.
00020  * ====================================================================
00021  * @endcopyright
00022  *
00023  * @file svn_client_mtcc.h
00024  * @brief Subversion multicommand client support
00025  *
00026  * Requires:  The working copy library and client library.
00027  * Provides:  High level multicommand api.
00028  * Used By:   Client programs, svnmucc.
00029  */
00030 
00031 #ifndef SVN_CLIENT_MTCC_H
00032 #define SVN_CLIENT_MTCC_H
00033 
00034 #include "svn_client.h"
00035 
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif /* __cplusplus */
00039 
00040 
00041 /**
00042  *
00043  * @defgroup clnt_mtcc Multi Command Context related functions
00044  *
00045  * @{
00046  *
00047  */
00048 
00049 /** This is a structure which stores a list of repository commands
00050  * that can be played to a repository as a single operation
00051  *
00052  * Use svn_client_mtcc_create() to create instances
00053  *
00054  * @since New in 1.9.
00055  */
00056 typedef struct svn_client_mtcc_t svn_client_mtcc_t;
00057 
00058 /** Creates a new multicommand context for an operation on @a anchor_url and
00059  * its descendants.
00060  *
00061  * Allocate the context in @a result_pool and perform temporary allocations in
00062  * @a scratch_pool.
00063  *
00064  * @since New in 1.9.
00065  */
00066 svn_error_t *
00067 svn_client_mtcc_create(svn_client_mtcc_t **mtcc,
00068                        const char *anchor_url,
00069                        svn_revnum_t base_revision,
00070                        svn_client_ctx_t *ctx,
00071                        apr_pool_t *result_pool,
00072                        apr_pool_t *scratch_pool);
00073 
00074 /** Adds a file add operation of @a relpath to @a mtcc. If @a src_checksum
00075  * is not null it will be provided to the repository to verify if the file
00076  * was transferred successfully.
00077  *
00078  * Perform temporary allocations in @a scratch_pool.
00079  *
00080  * @note The current implementation keeps @a src_stream open until @a mtcc
00081  * is committed.
00082  *
00083  * @since New in 1.9.
00084  */
00085 svn_error_t *
00086 svn_client_mtcc_add_add_file(const char *relpath,
00087                              svn_stream_t *src_stream,
00088                              const svn_checksum_t *src_checksum,
00089                              svn_client_mtcc_t *mtcc,
00090                              apr_pool_t *scratch_pool);
00091 
00092 /** Adds a copy operation of the node @a src_relpath at revision @a revision
00093  * to @a dst_relpath to @a mtcc.
00094  *
00095  * Perform temporary allocations in @a scratch_pool.
00096  *
00097  * @since New in 1.9.
00098  */
00099 svn_error_t *
00100 svn_client_mtcc_add_copy(const char *src_relpath,
00101                          svn_revnum_t revision,
00102                          const char *dst_relpath,
00103                          svn_client_mtcc_t *mtcc,
00104                          apr_pool_t *scratch_pool);
00105 
00106 /** Adds a delete of @a relpath to @a mtcc.
00107  *
00108  * Perform temporary allocations in @a scratch_pool.
00109  *
00110  * @since New in 1.9.
00111  */
00112 svn_error_t *
00113 svn_client_mtcc_add_delete(const char *relpath,
00114                           svn_client_mtcc_t *mtcc,
00115                           apr_pool_t *scratch_pool);
00116 
00117 /** Adds an mkdir operation of @a relpath to @a mtcc.
00118  *
00119  * Perform temporary allocations in @a scratch_pool.
00120  *
00121  * @since New in 1.9.
00122  */
00123 svn_error_t *
00124 svn_client_mtcc_add_mkdir(const char *relpath,
00125                           svn_client_mtcc_t *mtcc,
00126                           apr_pool_t *scratch_pool);
00127 
00128 
00129 /** Adds a move operation of the node @a src_relpath to @a dst_relpath to
00130  * @a mtcc.
00131  *
00132  * Perform temporary allocations in @a scratch_pool.
00133  *
00134  * @since New in 1.9.
00135  */
00136 svn_error_t *
00137 svn_client_mtcc_add_move(const char *src_relpath,
00138                          const char *dst_relpath,
00139                          svn_client_mtcc_t *mtcc,
00140                          apr_pool_t *scratch_pool);
00141 
00142 /** Adds a propset operation for the property @a propname to @a propval
00143  * (which can be NULL for a delete) on @a relpath to @a mtcc.
00144  *
00145  * If @a skip_checks is not FALSE Subversion defined properties are verified
00146  * for correctness like svn_client_propset_remote()
00147  *
00148  * Perform temporary allocations in @a scratch_pool.
00149  *
00150  * @since New in 1.9.
00151  */
00152 svn_error_t *
00153 svn_client_mtcc_add_propset(const char *relpath,
00154                             const char *propname,
00155                             const svn_string_t *propval,
00156                             svn_boolean_t skip_checks,
00157                             svn_client_mtcc_t *mtcc,
00158                             apr_pool_t *scratch_pool);
00159 
00160 
00161 /** Adds an update file operation for @a relpath to @a mtcc.
00162  *
00163  * The final version of the file is provided with @a src_stream. If @a
00164  * src_checksum is provided it will be provided to the repository to verify
00165  * the final result.
00166  *
00167  * If @a base_checksum is provided it will be used by the repository to verify
00168  * if the base file matches this checksum.
00169  *
00170  * If @a base_stream is not NULL only the binary diff from @a base_stream to
00171  * @a src_stream is written to the repository.
00172  *
00173  * Perform temporary allocations in @a scratch_pool.
00174  *
00175  * @note Callers should assume that the mtcc requires @a src_stream and @a
00176  * base_stream to be valid until @a mtcc is committed.
00177  *
00178  * @since New in 1.9.
00179  */
00180 svn_error_t *
00181 svn_client_mtcc_add_update_file(const char *relpath,
00182                                 svn_stream_t *src_stream,
00183                                 const svn_checksum_t *src_checksum,
00184                                 svn_stream_t *base_stream,
00185                                 const svn_checksum_t *base_checksum,
00186                                 svn_client_mtcc_t *mtcc,
00187                                 apr_pool_t *scratch_pool);
00188 
00189 /** Obtains the kind of node at @a relpath in the current state of @a mtcc.
00190  * This value might be from the cache (in case of modifications, copies)
00191  * or fetched from the repository.
00192  *
00193  * If @a check_repository is TRUE, verify the node type with the repository at
00194  * least once and cache the result for further checks.
00195  *
00196  * When a node does not exist this functions sets @a *kind to @c svn_node_node.
00197  *
00198  * @since New in 1.9.
00199  */
00200 svn_error_t *
00201 svn_client_mtcc_check_path(svn_node_kind_t *kind,
00202                            const char *relpath,
00203                            svn_boolean_t check_repository,
00204                            svn_client_mtcc_t *mtcc,
00205                            apr_pool_t *scratch_pool);
00206 
00207 /** Commits all operations stored in @a mtcc as a new revision and destroys
00208  * @a mtcc.
00209  *
00210  * @since New in 1.9.
00211  */
00212 svn_error_t *
00213 svn_client_mtcc_commit(apr_hash_t *revprop_table,
00214                        svn_commit_callback2_t commit_callback,
00215                        void *commit_baton,
00216                        svn_client_mtcc_t *mtcc,
00217                        apr_pool_t *scratch_pool);
00218 
00219 
00220 /** @} end group: Multi Command Context related functions */
00221 
00222 #ifdef __cplusplus
00223 }
00224 #endif /* __cplusplus */
00225 
00226 #endif  /* SVN_CLIENT_MTCC_H */

Generated on Mon Mar 17 15:46:32 2014 for Subversion by  doxygen 1.4.7