svn_mergeinfo.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_mergeinfo.h
00024  * @brief mergeinfo handling and processing
00025  */
00026 
00027 
00028 #ifndef SVN_MERGEINFO_H
00029 #define SVN_MERGEINFO_H
00030 
00031 #include <apr_pools.h>
00032 #include <apr_tables.h>  /* for apr_array_header_t */
00033 #include <apr_hash.h>
00034 
00035 #include "svn_types.h"
00036 #include "svn_string.h"  /* for svn_string_t */
00037 
00038 
00039 #ifdef __cplusplus
00040 extern "C" {
00041 #endif /* __cplusplus */
00042 
00043 /** Overview of the @c SVN_PROP_MERGEINFO property.
00044  *
00045  * Merge history is stored in the @c SVN_PROP_MERGEINFO property of files
00046  * and directories.  The @c SVN_PROP_MERGEINFO property on a path stores the
00047  * complete list of changes merged to that path, either directly or via the
00048  * path's parent, grand-parent, etc..  A path may have empty mergeinfo which
00049  * means that nothing has been merged to that path or all previous merges
00050  * to the path were reversed.  Note that a path may have no mergeinfo, this
00051  * is not the same as empty mergeinfo.
00052  *
00053  * Every path in a tree may have @c SVN_PROP_MERGEINFO set, but if the
00054  * @c SVN_PROP_MERGEINFO for a path is equivalent to the
00055  * @c SVN_PROP_MERGEINFO for its parent, then the @c SVN_PROP_MERGEINFO on
00056  * the path will 'elide' (be removed) from the path as a post step to any
00057  * merge.  If a path's parent does not have any @c SVN_PROP_MERGEINFO set,
00058  * the path's mergeinfo can elide to its nearest grand-parent,
00059  * great-grand-parent, etc. that has equivalent @c SVN_PROP_MERGEINFO set
00060  * on it.
00061  *
00062  * If a path has no @c SVN_PROP_MERGEINFO of its own, it inherits mergeinfo
00063  * from its nearest parent that has @c SVN_PROP_MERGEINFO set.  The
00064  * exception to this is @c SVN_PROP_MERGEINFO with non-inheritable revision
00065  * ranges.  These non-inheritable ranges apply only to the path which they
00066  * are set on.
00067  *
00068  * Due to Subversion's allowance for mixed revision working copies, both
00069  * elision and inheritance within the working copy presume the path
00070  * between a path and its nearest parent with mergeinfo is at the same
00071  * working revision.  If this is not the case then neither inheritance nor
00072  * elision can occur.
00073  *
00074  * The value of the @c SVN_PROP_MERGEINFO property is either an empty string
00075  * (representing empty mergeinfo) or a non-empty string consisting of
00076  * a path, a colon, and comma separated revision list, containing one or more
00077  * revision or revision ranges. Revision range start and end points are
00078  * separated by "-".  Revisions and revision ranges may have the optional
00079  * @c SVN_MERGEINFO_NONINHERITABLE_STR suffix to signify a non-inheritable
00080  * revision/revision range.
00081  *
00082  * @c SVN_PROP_MERGEINFO Value Grammar:
00083  *
00084  *   Token             Definition
00085  *   -----             ----------
00086  *   revisionrange     REVISION1 "-" REVISION2
00087  *   revisioneelement  (revisionrange | REVISION)"*"?
00088  *   rangelist         revisioneelement (COMMA revisioneelement)*
00089  *   revisionline      PATHNAME COLON rangelist
00090  *   top               "" | (revisionline (NEWLINE revisionline))*
00091  *
00092  * The PATHNAME is the source of a merge and the rangelist the revision(s)
00093  * merged to the path @c SVN_PROP_MERGEINFO is set on directly or indirectly
00094  * via inheritance.  PATHNAME must always exist at the specified rangelist
00095  * and thus a single merge may result in multiple revisionlines if the source
00096  * was renamed.
00097  *
00098  * Rangelists must be sorted from lowest to highest revision and cannot
00099  * contain overlapping revisionlistelements.  REVISION1 must be less than
00100  * REVISION2.  Consecutive single revisions that can be represented by a
00101  * revisionrange are allowed however (e.g. '5,6,7,8,9-12' or '5-12' are
00102  * both acceptable).
00103  */
00104 
00105 /* Suffix for SVN_PROP_MERGEINFO revision ranges indicating a given
00106    range is non-inheritable. */
00107 #define SVN_MERGEINFO_NONINHERITABLE_STR "*"
00108 
00109 /** Terminology for data structures that contain mergeinfo.
00110  *
00111  * Subversion commonly uses several data structures to represent
00112  * mergeinfo in RAM:
00113  *
00114  * (a) Strings (@c svn_string_t *) containing "unparsed mergeinfo".
00115  *
00116  * (b) @c svn_rangelist_t, called a "rangelist".  An array of non-
00117  *     overlapping merge ranges (@c svn_merge_range_t *), sorted as said by
00118  *     @c svn_sort_compare_ranges().  An empty range list is represented by
00119  *     an empty array.  Unless specifically noted otherwise, all APIs require
00120  *     rangelists that describe only forward ranges, i.e. the range's start
00121  *     revision is less than its end revision.
00122  *
00123  * (c) @c svn_mergeinfo_t, called "mergeinfo".  A hash mapping merge
00124  *     source paths (@c const char *, starting with slashes) to
00125  *     non-empty rangelist arrays.  A @c NULL hash is used to represent
00126  *     no mergeinfo and an empty hash is used to represent empty
00127  *     mergeinfo.
00128  *
00129  * (d) @c svn_mergeinfo_catalog_t, called a "mergeinfo catalog".  A hash
00130  *     mapping paths (@c const char *) to @c svn_mergeinfo_t.
00131  *
00132  * Both @c svn_mergeinfo_t and @c svn_mergeinfo_catalog_t are just
00133  * typedefs for @c apr_hash_t *; there is no static type-checking, and
00134  * you still use standard @c apr_hash_t functions to interact with
00135  * them.
00136  *
00137  * Note that while the keys of mergeinfos are always absolute from the
00138  * repository root, the keys of a catalog may be relative to something
00139  * else, such as an RA session root.
00140  */
00141 
00142 typedef apr_array_header_t svn_rangelist_t;
00143 typedef apr_hash_t *svn_mergeinfo_t;
00144 typedef apr_hash_t *svn_mergeinfo_catalog_t;
00145 
00146 /** Parse the mergeinfo from @a input into @a *mergeinfo.  If no
00147  * mergeinfo is available, return an empty mergeinfo (never @c NULL).
00148  *
00149  * If @a input is not a grammatically correct @c SVN_PROP_MERGEINFO
00150  * property, contains overlapping revision ranges of differing
00151  * inheritability, or revision ranges with a start revision greater
00152  * than or equal to its end revision, or contains paths mapped to empty
00153  * revision ranges, then return  @c SVN_ERR_MERGEINFO_PARSE_ERROR.
00154  * Unordered revision ranges are  allowed, but will be sorted when
00155  * placed into @a *mergeinfo.  Overlapping revision ranges of the same
00156  * inheritability are also allowed, but will be combined into a single
00157  * range when placed into @a *mergeinfo.
00158  *
00159  * @a input may contain relative merge source paths, but these are
00160  * converted to absolute paths in @a *mergeinfo.
00161  *
00162  * Allocate the result deeply in @a pool. Also perform temporary
00163  * allocations in @a pool.
00164  *
00165  * @since New in 1.5.
00166  */
00167 svn_error_t *
00168 svn_mergeinfo_parse(svn_mergeinfo_t *mergeinfo, const char *input,
00169                     apr_pool_t *pool);
00170 
00171 /** Calculate the delta between two mergeinfos, @a mergefrom and @a mergeto
00172  * (either or both of which may be @c NULL meaning an empty mergeinfo).
00173  * Place the result in @a *deleted and @a *added (neither output argument
00174  * may be @c NULL), both allocated in @a result_pool.  The resulting
00175  * @a *deleted and @a *added will not be null.
00176  *
00177  * @a consider_inheritance determines how the rangelists in the two
00178  * hashes are compared for equality.  If @a consider_inheritance is FALSE,
00179  * then the start and end revisions of the @c svn_merge_range_t's being
00180  * compared are the only factors considered when determining equality.
00181  *
00182  *  e.g. '/trunk: 1,3-4*,5' == '/trunk: 1,3-5'
00183  *
00184  * If @a consider_inheritance is TRUE, then the inheritability of the
00185  * @c svn_merge_range_t's is also considered and must be the same for two
00186  * otherwise identical ranges to be judged equal.
00187  *
00188  *  e.g. '/trunk: 1,3-4*,5' != '/trunk: 1,3-5'
00189  *       '/trunk: 1,3-4*,5' == '/trunk: 1,3-4*,5'
00190  *       '/trunk: 1,3-4,5'  == '/trunk: 1,3-4,5'
00191  *
00192  * @since New in 1.8.
00193  */
00194 svn_error_t *
00195 svn_mergeinfo_diff2(svn_mergeinfo_t *deleted, svn_mergeinfo_t *added,
00196                     svn_mergeinfo_t mergefrom, svn_mergeinfo_t mergeto,
00197                     svn_boolean_t consider_inheritance,
00198                     apr_pool_t *result_pool,
00199                     apr_pool_t *scratch_pool);
00200 
00201 /** Similar to svn_mergeinfo_diff2(), but users only one pool.
00202  *
00203  * @deprecated Provided for backward compatibility with the 1.7 API.
00204  * @since New in 1.5.
00205  */
00206 SVN_DEPRECATED
00207 svn_error_t *
00208 svn_mergeinfo_diff(svn_mergeinfo_t *deleted, svn_mergeinfo_t *added,
00209                    svn_mergeinfo_t mergefrom, svn_mergeinfo_t mergeto,
00210                    svn_boolean_t consider_inheritance,
00211                    apr_pool_t *pool);
00212 
00213 /** Merge a shallow copy of one mergeinfo, @a changes, into another mergeinfo
00214  * @a mergeinfo.
00215  *
00216  * Rangelists for merge source paths common to @a changes and @a mergeinfo may
00217  * result in new rangelists; these are allocated in @a result_pool.
00218  * Temporary allocations are made in @a scratch_pool.
00219  *
00220  * When intersecting rangelists for a path are merged, the inheritability of
00221  * the resulting svn_merge_range_t depends on the inheritability of the
00222  * operands.  If two non-inheritable ranges are merged the result is always
00223  * non-inheritable, in all other cases the resulting range is inheritable.
00224  *
00225  *  e.g. '/A: 1,3-4'  merged with '/A: 1,3,4*,5' --> '/A: 1,3-5'
00226  *       '/A: 1,3-4*' merged with '/A: 1,3,4*,5' --> '/A: 1,3,4*,5'
00227  *
00228  * @since New in 1.8.
00229  */
00230 svn_error_t *
00231 svn_mergeinfo_merge2(svn_mergeinfo_t mergeinfo,
00232                      svn_mergeinfo_t changes,
00233                      apr_pool_t *result_pool,
00234                      apr_pool_t *scratch_pool);
00235 
00236 /** Like svn_mergeinfo_merge2, but uses only one pool.
00237  *
00238  * @deprecated Provided for backward compatibility with the 1.5 API.
00239  */
00240 SVN_DEPRECATED
00241 svn_error_t *
00242 svn_mergeinfo_merge(svn_mergeinfo_t mergeinfo,
00243                     svn_mergeinfo_t changes,
00244                     apr_pool_t *pool);
00245 
00246 /** Combine one mergeinfo catalog, @a changes_catalog, into another mergeinfo
00247  * catalog @a mergeinfo_catalog.  If both catalogs have mergeinfo for the same
00248  * key, use svn_mergeinfo_merge() to combine the mergeinfos.
00249  *
00250  * Additions to @a mergeinfo_catalog are deep copies allocated in
00251  * @a result_pool.  Temporary allocations are made in @a scratch_pool.
00252  *
00253  * @since New in 1.7.
00254  */
00255 svn_error_t *
00256 svn_mergeinfo_catalog_merge(svn_mergeinfo_catalog_t mergeinfo_catalog,
00257                             svn_mergeinfo_catalog_t changes_catalog,
00258                             apr_pool_t *result_pool,
00259                             apr_pool_t *scratch_pool);
00260 
00261 /** Like svn_mergeinfo_remove2, but always considers inheritance.
00262  *
00263  * @deprecated Provided for backward compatibility with the 1.6 API.
00264  */
00265 SVN_DEPRECATED
00266 svn_error_t *
00267 svn_mergeinfo_remove(svn_mergeinfo_t *mergeinfo, svn_mergeinfo_t eraser,
00268                      svn_mergeinfo_t whiteboard, apr_pool_t *pool);
00269 
00270 /** Removes @a eraser (the subtrahend) from @a whiteboard (the
00271  * minuend), and places the resulting difference in @a *mergeinfo.
00272  * Allocates @a *mergeinfo in @a result_pool.  Temporary allocations
00273  * will be performed in @a scratch_pool.
00274  *
00275  * @a consider_inheritance determines how to account for the inheritability
00276  * of the two mergeinfo's ranges when calculating the range equivalence,
00277  * as described for svn_mergeinfo_diff().
00278  *
00279  * @since New in 1.7.
00280  */
00281 svn_error_t *
00282 svn_mergeinfo_remove2(svn_mergeinfo_t *mergeinfo,
00283                       svn_mergeinfo_t eraser,
00284                       svn_mergeinfo_t whiteboard,
00285                       svn_boolean_t consider_inheritance,
00286                       apr_pool_t *result_pool,
00287                       apr_pool_t *scratch_pool);
00288 
00289 /** Calculate the delta between two rangelists consisting of @c
00290  * svn_merge_range_t * elements (sorted in ascending order), @a from
00291  * and @a to, and place the result in @a *deleted and @a *added
00292  * (neither output argument will ever be @c NULL).
00293  *
00294  * @a consider_inheritance determines how to account for the inheritability
00295  * of the two rangelist's ranges when calculating the diff,
00296  * as described for svn_mergeinfo_diff().
00297  *
00298  * @since New in 1.5.
00299  */
00300 svn_error_t *
00301 svn_rangelist_diff(svn_rangelist_t **deleted, svn_rangelist_t **added,
00302                    const svn_rangelist_t *from, const svn_rangelist_t *to,
00303                    svn_boolean_t consider_inheritance,
00304                    apr_pool_t *pool);
00305 
00306 /** Merge two rangelists consisting of @c svn_merge_range_t *
00307  * elements, @a rangelist and @a changes, placing the results in
00308  * @a rangelist. New elements added to @a rangelist are allocated
00309  * in @a result_pool. Either rangelist may be empty.
00310  *
00311  * When intersecting rangelists are merged, the inheritability of
00312  * the resulting svn_merge_range_t depends on the inheritability of the
00313  * operands: see svn_mergeinfo_merge().
00314  *
00315  * Note: @a rangelist and @a changes must be sorted as said by @c
00316  * svn_sort_compare_ranges().  @a rangelist is guaranteed to remain
00317  * in sorted order and be compacted to the minimal number of ranges
00318  * needed to represent the merged result.
00319  *
00320  * If the original rangelist contains non-collapsed adjacent ranges,
00321  * the final result is not guaranteed to be compacted either.
00322  *
00323  * Use @a scratch_pool for temporary allocations.
00324  *
00325  * @since New in 1.8.
00326  */
00327 svn_error_t *
00328 svn_rangelist_merge2(svn_rangelist_t *rangelist,
00329                      const svn_rangelist_t *changes,
00330                      apr_pool_t *result_pool,
00331                      apr_pool_t *scratch_pool);
00332 
00333 /** Like svn_rangelist_merge2(), but with @a rangelist as an input/output
00334  * argument. This function always allocates a new rangelist in @a pool and
00335  * returns its result in @a *rangelist. It does not modify @a *rangelist
00336  * in place. If not used carefully, this function can use up a lot of memory
00337  * if called in a loop.
00338  *
00339  * It performs an extra adjacent range compaction round to make sure non
00340  * collapsed input ranges are compacted in the result.
00341  *
00342  * @since New in 1.5.
00343  * @deprecated Provided for backward compatibility with the 1.7 API.
00344  */
00345 SVN_DEPRECATED
00346 svn_error_t *
00347 svn_rangelist_merge(svn_rangelist_t **rangelist,
00348                     const svn_rangelist_t *changes,
00349                     apr_pool_t *pool);
00350 
00351 /** Removes @a eraser (the subtrahend) from @a whiteboard (the
00352  * minuend), and places the resulting difference in @a output.
00353  *
00354  * Note: @a eraser and @a whiteboard must be sorted as said by @c
00355  * svn_sort_compare_ranges().  @a output is guaranteed to be in sorted
00356  * order.
00357  *
00358  * @a consider_inheritance determines how to account for the
00359  * @c svn_merge_range_t inheritable field when comparing @a whiteboard's
00360  * and @a *eraser's rangelists for equality.  @see svn_mergeinfo_diff().
00361  *
00362  * Allocate the entire output in @a pool.
00363  *
00364  * @since New in 1.5.
00365  */
00366 svn_error_t *
00367 svn_rangelist_remove(svn_rangelist_t **output, const svn_rangelist_t *eraser,
00368                      const svn_rangelist_t *whiteboard,
00369                      svn_boolean_t consider_inheritance,
00370                      apr_pool_t *pool);
00371 
00372 /** Find the intersection of two mergeinfos, @a mergeinfo1 and @a
00373  * mergeinfo2, and place the result in @a *mergeinfo, which is (deeply)
00374  * allocated in @a result_pool.  Temporary allocations will be performed
00375  * in @a scratch_pool.
00376  *
00377  * @a consider_inheritance determines how to account for the inheritability
00378  * of the two mergeinfo's ranges when calculating the range equivalence,
00379  * @see svn_rangelist_intersect().
00380  *
00381  * @since New in 1.7.
00382  */
00383 svn_error_t *
00384 svn_mergeinfo_intersect2(svn_mergeinfo_t *mergeinfo,
00385                          svn_mergeinfo_t mergeinfo1,
00386                          svn_mergeinfo_t mergeinfo2,
00387                          svn_boolean_t consider_inheritance,
00388                          apr_pool_t *result_pool,
00389                          apr_pool_t *scratch_pool);
00390 
00391 /** Like svn_mergeinfo_intersect2, but always considers inheritance.
00392  *
00393  * @deprecated Provided for backward compatibility with the 1.6 API.
00394  */
00395 SVN_DEPRECATED
00396 svn_error_t *
00397 svn_mergeinfo_intersect(svn_mergeinfo_t *mergeinfo,
00398                         svn_mergeinfo_t mergeinfo1,
00399                         svn_mergeinfo_t mergeinfo2,
00400                         apr_pool_t *pool);
00401 
00402 /** Find the intersection of two rangelists consisting of @c
00403  * svn_merge_range_t * elements, @a rangelist1 and @a rangelist2, and
00404  * place the result in @a *rangelist (which is never @c NULL).
00405  *
00406  * @a consider_inheritance determines how to account for the inheritability
00407  * of the two rangelist's ranges when calculating the intersection,
00408  * @see svn_mergeinfo_diff().  If @a consider_inheritance is FALSE then
00409  * ranges with different inheritance can intersect, but the resulting
00410  * @a *rangelist is non-inheritable only if the corresponding ranges from
00411  * both @a rangelist1 and @a rangelist2 are non-inheritable.
00412  * If @a consider_inheritance is TRUE, then ranges with different
00413  * inheritance can never intersect.
00414  *
00415  * Note: @a rangelist1 and @a rangelist2 must be sorted as said by @c
00416  * svn_sort_compare_ranges(). @a *rangelist is guaranteed to be in sorted
00417  * order.
00418  *
00419  * Allocate the entire output in @a pool.
00420  *
00421  * @since New in 1.5.
00422  */
00423 svn_error_t *
00424 svn_rangelist_intersect(svn_rangelist_t **rangelist,
00425                         const svn_rangelist_t *rangelist1,
00426                         const svn_rangelist_t *rangelist2,
00427                         svn_boolean_t consider_inheritance,
00428                         apr_pool_t *pool);
00429 
00430 /** Reverse @a rangelist, and the @c start and @c end fields of each
00431  * range in @a rangelist, in place.
00432  *
00433  * TODO(miapi): Is this really a valid function?  Rangelists that
00434  * aren't sorted, or rangelists containing reverse ranges, are
00435  * generally not valid in mergeinfo code.  Can we rewrite the two
00436  * places where this is used?
00437  *
00438  * @since New in 1.5.
00439  */
00440 svn_error_t *
00441 svn_rangelist_reverse(svn_rangelist_t *rangelist, apr_pool_t *pool);
00442 
00443 /** Take an array of svn_merge_range_t *'s in @a rangelist, and convert it
00444  * back to a text format rangelist in @a output.  If @a rangelist contains
00445  * no elements, sets @a output to the empty string.
00446  *
00447  * @since New in 1.5.
00448  */
00449 svn_error_t *
00450 svn_rangelist_to_string(svn_string_t **output,
00451                         const svn_rangelist_t *rangelist,
00452                         apr_pool_t *pool);
00453 
00454 /** Remove non-inheritable or inheritable revision ranges from a rangelist.
00455  *
00456  * Set @a *inheritable_rangelist to a deep copy of @a rangelist, excluding
00457  * all non-inheritable @c svn_merge_range_t if @a inheritable is TRUE or
00458  * excluding all inheritable @c svn_merge_range_t otherwise.
00459  *
00460  * If @a start and @a end are valid revisions and @a start is less than or
00461  * equal to @a end, then exclude only the (non-inheritable or inheritable)
00462  * revision ranges that intersect inclusively with the range defined by
00463  * @a start and @a end.
00464  *
00465  * If there are no remaining ranges, return an empty array.
00466  *
00467  * Allocate the copy in @a result_pool, and use @a scratch_pool for
00468  * temporary allocations.
00469  *
00470  * @since New in 1.7.
00471  */
00472 svn_error_t *
00473 svn_rangelist_inheritable2(svn_rangelist_t **inheritable_rangelist,
00474                            const svn_rangelist_t *rangelist,
00475                            svn_revnum_t start,
00476                            svn_revnum_t end,
00477                            svn_boolean_t inheritable,
00478                            apr_pool_t *result_pool,
00479                            apr_pool_t *scratch_pool);
00480 
00481 /** Like svn_rangelist_inheritable2, but always finds inheritable ranges.
00482  *
00483  * @since New in 1.5.
00484  * @deprecated Provided for backward compatibility with the 1.6 API.
00485  */
00486 SVN_DEPRECATED
00487 svn_error_t *
00488 svn_rangelist_inheritable(svn_rangelist_t **inheritable_rangelist,
00489                           const svn_rangelist_t *rangelist,
00490                           svn_revnum_t start,
00491                           svn_revnum_t end,
00492                           apr_pool_t *pool);
00493 
00494 /** Remove non-inheritable or inheritable revision ranges from mergeinfo.
00495  *
00496  * Set @a *inheritable_mergeinfo to a deep copy of @a mergeinfo, excluding
00497  * all non-inheritable @c svn_merge_range_t if @a inheritable is TRUE or
00498  * excluding all inheritable @c svn_merge_range_t otherwise.
00499  *
00500  * If @a start and @a end are valid revisions and @a start is less than or
00501  * equal to @a end, then exclude only the (non-inheritable or inheritable)
00502  * revisions that intersect inclusively with the range defined by @a start
00503  * and @a end.
00504  *
00505  * If @a path is not NULL remove (non-inheritable or inheritable) ranges
00506  * only for @a path.
00507  *
00508  * If all ranges are removed for a given path then remove that path as well.
00509  * If @a mergeinfo is initially empty or all paths are removed from it then
00510  * set @a *inheritable_mergeinfo to an empty mergeinfo.
00511  *
00512  * Allocate the copy in @a result_pool, and use @a scratch_pool for
00513  * temporary allocations.
00514  *
00515  * @since New in 1.7.
00516  */
00517 svn_error_t *
00518 svn_mergeinfo_inheritable2(svn_mergeinfo_t *inheritable_mergeinfo,
00519                            svn_mergeinfo_t mergeinfo,
00520                            const char *path,
00521                            svn_revnum_t start,
00522                            svn_revnum_t end,
00523                            svn_boolean_t inheritable,
00524                            apr_pool_t *result_pool,
00525                            apr_pool_t *scratch_pool);
00526 
00527 /** Like svn_mergeinfo_inheritable2, but always finds inheritable mergeinfo.
00528  *
00529  * @since New in 1.5.
00530  * @deprecated Provided for backward compatibility with the 1.6 API.
00531  */
00532 SVN_DEPRECATED
00533 svn_error_t *
00534 svn_mergeinfo_inheritable(svn_mergeinfo_t *inheritable_mergeinfo,
00535                           svn_mergeinfo_t mergeinfo,
00536                           const char *path,
00537                           svn_revnum_t start,
00538                           svn_revnum_t end,
00539                           apr_pool_t *pool);
00540 
00541 /** Take a mergeinfo in @a mergeinput, and convert it to unparsed
00542  *  mergeinfo. Set @a *output to the result, allocated in @a pool.
00543  *  If @a input contains no elements, set @a *output to the empty string.
00544  *
00545  * @a mergeinput may contain relative merge source paths, but these are
00546  * converted to absolute paths in @a *output.
00547  *
00548  * @since New in 1.5.
00549 */
00550 svn_error_t *
00551 svn_mergeinfo_to_string(svn_string_t **output,
00552                         svn_mergeinfo_t mergeinput,
00553                         apr_pool_t *pool);
00554 
00555 /** Take a hash of mergeinfo in @a mergeinfo, and sort the rangelists
00556  * associated with each key (in place).
00557  *
00558  * TODO(miapi): mergeinfos should *always* be sorted.  This should be
00559  * a private function.
00560  *
00561  * @since New in 1.5
00562  */
00563 svn_error_t *
00564 svn_mergeinfo_sort(svn_mergeinfo_t mergeinfo, apr_pool_t *pool);
00565 
00566 /** Return a deep copy of @a mergeinfo_catalog, allocated in @a pool.
00567  *
00568  * @since New in 1.6.
00569  */
00570 svn_mergeinfo_catalog_t
00571 svn_mergeinfo_catalog_dup(svn_mergeinfo_catalog_t mergeinfo_catalog,
00572                           apr_pool_t *pool);
00573 
00574 /** Return a deep copy of @a mergeinfo, allocated in @a pool.
00575  *
00576  * @since New in 1.5.
00577  */
00578 svn_mergeinfo_t
00579 svn_mergeinfo_dup(svn_mergeinfo_t mergeinfo, apr_pool_t *pool);
00580 
00581 /** Return a deep copy of @a rangelist, allocated in @a pool.
00582  *
00583  * @since New in 1.5.
00584  */
00585 svn_rangelist_t *
00586 svn_rangelist_dup(const svn_rangelist_t *rangelist, apr_pool_t *pool);
00587 
00588 
00589 /**
00590  * The three ways to request mergeinfo affecting a given path.
00591  *
00592  * @since New in 1.5.
00593  */
00594 typedef enum svn_mergeinfo_inheritance_t
00595 {
00596   /** Explicit mergeinfo only. */
00597   svn_mergeinfo_explicit,
00598 
00599   /** Explicit mergeinfo, or if that doesn't exist, the inherited
00600       mergeinfo from a target's nearest (path-wise, not history-wise)
00601       ancestor. */
00602   svn_mergeinfo_inherited,
00603 
00604   /** Mergeinfo inherited from a target's nearest (path-wise, not
00605       history-wise) ancestor, regardless of whether target has explicit
00606       mergeinfo. */
00607   svn_mergeinfo_nearest_ancestor
00608 } svn_mergeinfo_inheritance_t;
00609 
00610 /** Return a constant string expressing @a inherit as an English word,
00611  * i.e., "explicit" (default), "inherited", or "nearest_ancestor".
00612  * The string is not localized, as it may be used for client<->server
00613  * communications.
00614  *
00615  * @since New in 1.5.
00616  */
00617 const char *
00618 svn_inheritance_to_word(svn_mergeinfo_inheritance_t inherit);
00619 
00620 
00621 /** Return the appropriate @c svn_mergeinfo_inheritance_t for @a word.
00622  * @a word is as returned from svn_inheritance_to_word().  Defaults to
00623  * @c svn_mergeinfo_explicit.
00624  *
00625  * @since New in 1.5.
00626  */
00627 svn_mergeinfo_inheritance_t
00628 svn_inheritance_from_word(const char *word);
00629 
00630 
00631 #ifdef __cplusplus
00632 }
00633 #endif /* __cplusplus */
00634 
00635 #endif /* SVN_MERGEINFO_H */

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