Subversion
svn_dav.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_dav.h
00024  * @brief Code related to WebDAV/DeltaV usage in Subversion.
00025  */
00026 
00027 
00028 
00029 
00030 #ifndef SVN_DAV_H
00031 #define SVN_DAV_H
00032 
00033 
00034 #ifdef __cplusplus
00035 extern "C" {
00036 #endif /* __cplusplus */
00037 
00038 
00039 /** This is the MIME type that Subversion uses for its "svndiff" format.
00040  *
00041  * This is an application type, for the "svn" vendor. The specific subtype
00042  * is "svndiff".
00043  */
00044 #define SVN_SVNDIFF_MIME_TYPE "application/vnd.svn-svndiff"
00045 
00046 /** This is the MIME type that Subversion users for its "skel" format.
00047  *
00048  * This is an application type, for the "svn" vendor. The specific subtype
00049  * is "skel".
00050  * @since New in 1.7.
00051  */
00052 #define SVN_SKEL_MIME_TYPE "application/vnd.svn-skel"
00053 
00054 /** This header is *TEMPORARILY* used to transmit the delta base to the
00055  * server. It contains a version resource URL for what is on the client.
00056  */
00057 #define SVN_DAV_DELTA_BASE_HEADER "X-SVN-VR-Base"
00058 
00059 /** This header is used when an svn client wants to trigger specific
00060  * svn server behaviors.  Normal WebDAV or DeltaV clients won't use it.
00061  */
00062 #define SVN_DAV_OPTIONS_HEADER "X-SVN-Options"
00063 
00064 /**
00065  * @name options-header defines
00066  * Specific options that can appear in the options-header:
00067  * @{
00068  */
00069 #define SVN_DAV_OPTION_NO_MERGE_RESPONSE "no-merge-response"
00070 #define SVN_DAV_OPTION_LOCK_BREAK        "lock-break"
00071 #define SVN_DAV_OPTION_LOCK_STEAL        "lock-steal"
00072 #define SVN_DAV_OPTION_RELEASE_LOCKS     "release-locks"
00073 #define SVN_DAV_OPTION_KEEP_LOCKS        "keep-locks"
00074 /** @} */
00075 
00076 /** This header is used when an svn client wants to tell mod_dav_svn
00077  * exactly what revision of a resource it thinks it's operating on.
00078  * (For example, an svn server can use it to validate a DELETE request.)
00079  * Normal WebDAV or DeltaV clients won't use it.
00080  */
00081 #define SVN_DAV_VERSION_NAME_HEADER "X-SVN-Version-Name"
00082 
00083 /** A header generated by mod_dav_svn whenever it responds
00084     successfully to a LOCK request.  Only svn clients will notice it,
00085     and use it to fill in svn_lock_t->creation_date.   */
00086 #define SVN_DAV_CREATIONDATE_HEADER "X-SVN-Creation-Date"
00087 
00088 /** A header generated by mod_dav_svn whenever it responds
00089     successfully to a PROPFIND for the 'DAV:lockdiscovery' property.
00090     Only svn clients will notice it, and use it to fill in
00091     svn_lock_t->owner.  (Remember that the DAV:owner field maps to
00092     svn_lock_t->comment, and that there is no analogue in the DAV
00093     universe of svn_lock_t->owner.)  */
00094 #define SVN_DAV_LOCK_OWNER_HEADER "X-SVN-Lock-Owner"
00095 
00096 /** Assuming the OPTIONS was performed against a resource within a
00097  * Subversion repository, then this header indicates the youngest
00098  * revision in the repository.
00099  * @since New in 1.7.  */
00100 #define SVN_DAV_YOUNGEST_REV_HEADER "SVN-Youngest-Rev"
00101 
00102 /** Assuming the OPTIONS was performed against a resource within a
00103  * Subversion repository, then this header indicates the UUID of the
00104  * repository.
00105  * @since New in 1.7.  */
00106 #define SVN_DAV_REPOS_UUID_HEADER "SVN-Repository-UUID"
00107 
00108 /** Presence of this in a DAV header in an OPTIONS response indicates
00109  * that the server speaks HTTP protocol v2.  This header provides an
00110  * opaque URI that the client should send all custom REPORT requests
00111  * against.
00112  * @since New in 1.7.  */
00113 #define SVN_DAV_ME_RESOURCE_HEADER "SVN-Me-Resource"
00114 
00115 /** This header provides the repository root URI, suitable for use in
00116  * calculating the relative paths of other public URIs for this
00117  * repository into .  (HTTP protocol v2 only)
00118  * @since New in 1.7.  */
00119 #define SVN_DAV_ROOT_URI_HEADER "SVN-Repository-Root"
00120 
00121 /** This header provides an opaque URI that the client can append a
00122  * revision to, to construct a 'revision URL'.  This allows direct
00123  * read/write access to revprops via PROPFIND or PROPPATCH, and is
00124  * similar to libsvn_fs's revision objects (as distinct from "revision
00125  * roots").  (HTTP protocol v2 only)
00126  * @since New in 1.7.  */
00127 #define SVN_DAV_REV_STUB_HEADER "SVN-Rev-Stub"
00128 
00129 /** This header provides an opaque URI that the client can append
00130  * PEGREV/PATH to, in order to construct URIs of pegged objects in the
00131  * repository, similar to the use of a "revision root" in the
00132  * libsvn_fs API.  (HTTP protocol v2 only)
00133  * @since New in 1.7.  */
00134 #define SVN_DAV_REV_ROOT_STUB_HEADER "SVN-Rev-Root-Stub"
00135 
00136 /** This header provides an opaque URI which represents a Subversion
00137  * transaction (revision-in-progress) object.  It is suitable for use
00138  * in fetching and modifying transaction properties as part of a
00139  * commit process, similar to the svn_fs_txn_t object (as distinct
00140  * from a "txn root").  (HTTP protocol v2 only)
00141  * @since New in 1.7.  */
00142 #define SVN_DAV_TXN_STUB_HEADER "SVN-Txn-Stub"
00143 
00144 /** Companion to @c SVN_DAV_TXN_STUB_HEADER, used when a POST request
00145  *  returns @c SVN_DAV_VTXN_NAME_HEADER in response to a client
00146  *  supplied name.  (HTTP protocol v2 only)
00147  * @since New in 1.7.  */
00148 #define SVN_DAV_VTXN_STUB_HEADER "SVN-VTxn-Stub"
00149 
00150 /** This header provides an opaque URI which represents the root
00151  * directory of a Subversion transaction (revision-in-progress),
00152  * similar to the concept of a "txn root" in the libsvn_fs API.  The
00153  * client can append additional path segments to it to access items
00154  * deeper in the transaction tree as part of a commit process.  (HTTP
00155  * protocol v2 only)
00156  * @since New in 1.7.  */
00157 #define SVN_DAV_TXN_ROOT_STUB_HEADER "SVN-Txn-Root-Stub"
00158 
00159 /** Companion to @c SVN_DAV_TXN_ROOT_STUB_HEADER, used when a POST
00160  *  request returns @c SVN_DAV_VTXN_NAME_HEADER in response to a
00161  *  client supplied name.  (HTTP protocol v2 only)
00162  * @since New in 1.7.  */
00163 #define SVN_DAV_VTXN_ROOT_STUB_HEADER "SVN-VTxn-Root-Stub"
00164 
00165 /** This header is used in the POST response to tell the client the
00166  * name of the Subversion transaction created by the request.  It can
00167  * then be appended to the transaction stub and transaction root stub
00168  * for access to the properties and paths, respectively, of the named
00169  * transaction.  (HTTP protocol v2 only)
00170  * @since New in 1.7.  */
00171 #define SVN_DAV_TXN_NAME_HEADER "SVN-Txn-Name"
00172 
00173 /** This header is used in the POST request, to pass a client supplied
00174  * alternative transaction name to the server, and in the the POST
00175  * response, to tell the client that the alternative transaction
00176  * resource names should be used.  (HTTP protocol v2 only)
00177  * @since New in 1.7.  */
00178 #define SVN_DAV_VTXN_NAME_HEADER "SVN-VTxn-Name"
00179 
00180 /**
00181  * @name Fulltext MD5 headers
00182  *
00183  * These headers are for client and server to verify that the base
00184  * and the result of a change transmission are the same on both
00185  * sides, regardless of what transformations (svndiff deltification,
00186  * gzipping, etc) the data may have gone through in between.
00187  *
00188  * The result md5 is always used whenever file contents are
00189  * transferred, because every transmission has a resulting text.
00190  *
00191  * The base md5 is used to verify the base text against which svndiff
00192  * data is being applied.  Note that even for svndiff transmissions,
00193  * base verification is not strictly necessary (and may therefore be
00194  * unimplemented), as any error will be caught by the verification of
00195  * the final result.  However, if the problem is that the base text is
00196  * corrupt, the error will be caught earlier if the base md5 is used.
00197  *
00198  * Normal WebDAV or DeltaV clients don't use these.
00199  * @{
00200  */
00201 #define SVN_DAV_BASE_FULLTEXT_MD5_HEADER "X-SVN-Base-Fulltext-MD5"
00202 #define SVN_DAV_RESULT_FULLTEXT_MD5_HEADER "X-SVN-Result-Fulltext-MD5"
00203 /** @} */
00204 
00205 /* ### should add strings for the various XML elements in the reports
00206    ### and things. also the custom prop names. etc.
00207 */
00208 
00209 /** The svn-specific object that is placed within a <D:error> response.
00210  *
00211  * @defgroup svn_dav_error Errors in svn_dav
00212  * @{ */
00213 
00214 /** The error object's namespace */
00215 #define SVN_DAV_ERROR_NAMESPACE "svn:"
00216 
00217 /** The error object's tag */
00218 #define SVN_DAV_ERROR_TAG       "error"
00219 
00220 /** @} */
00221 
00222 
00223 /** General property (xml) namespaces that will be used by both ra_dav
00224  * and mod_dav_svn for marshalling properties.
00225  *
00226  * @defgroup svn_dav_property_xml_namespaces DAV property namespaces
00227  * @{
00228  */
00229 
00230 /** A property stored in the fs and wc, begins with 'svn:', and is
00231  * interpreted either by client or server.
00232  */
00233 #define SVN_DAV_PROP_NS_SVN "http://subversion.tigris.org/xmlns/svn/"
00234 
00235 /** A property stored in the fs and wc, but totally ignored by svn
00236  * client and server.
00237  *
00238  * A property simply invented by the users.
00239  */
00240 #define SVN_DAV_PROP_NS_CUSTOM "http://subversion.tigris.org/xmlns/custom/"
00241 
00242 /** A property purely generated and consumed by the network layer, not
00243  * seen by either fs or wc.
00244  */
00245 #define SVN_DAV_PROP_NS_DAV "http://subversion.tigris.org/xmlns/dav/"
00246 
00247 
00248 /**
00249  * @name Custom (extension) values for the DAV header.
00250  * Note that although these share the SVN_DAV_PROP_NS_DAV namespace
00251  * prefix, they are not properties; they are header values.
00252  *
00253  * @{ **/
00254 
00255 /** Presence of this in a DAV header in an OPTIONS request or response
00256  * indicates that the transmitter supports @c svn_depth_t. */
00257 #define SVN_DAV_NS_DAV_SVN_DEPTH SVN_DAV_PROP_NS_DAV "svn/depth"
00258 
00259 /** Presence of this in a DAV header in an OPTIONS request or response
00260  * indicates that the server knows how to handle merge-tracking
00261  * information.
00262  *
00263  * Note that this says nothing about whether the repository can handle
00264  * mergeinfo, only whether the server does.  For more information, see
00265  * mod_dav_svn/version.c:get_vsn_options().
00266  */
00267 #define SVN_DAV_NS_DAV_SVN_MERGEINFO SVN_DAV_PROP_NS_DAV "svn/mergeinfo"
00268 
00269 /** Presence of this in a DAV header in an OPTIONS response indicates
00270  * that the transmitter (in this case, the server) knows how to send
00271  * custom revprops in log responses. */
00272 #define SVN_DAV_NS_DAV_SVN_LOG_REVPROPS SVN_DAV_PROP_NS_DAV "svn/log-revprops"
00273 
00274 /** Presence of this in a DAV header in an OPTIONS response indicates
00275  * that the transmitter (in this case, the server) knows how to enforce
00276  * old-value atomicity in PROPPATCH (for editing revprops). */
00277 #define SVN_DAV_NS_DAV_SVN_ATOMIC_REVPROPS\
00278             SVN_DAV_PROP_NS_DAV "svn/atomic-revprops"
00279 
00280 /** Presence of this in a DAV header in an OPTIONS response indicates
00281  * that the transmitter (in this case, the server) knows how to handle
00282  * a replay of a directory in the repository (not root). */
00283 #define SVN_DAV_NS_DAV_SVN_PARTIAL_REPLAY\
00284             SVN_DAV_PROP_NS_DAV "svn/partial-replay"
00285 
00286 /** @} */
00287 
00288 /** @} */
00289 
00290 #ifdef __cplusplus
00291 }
00292 #endif /* __cplusplus */
00293 
00294 #endif  /* SVN_DAV_H */
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines