Subversion
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
svn_mergeinfo.h
Go to the documentation of this file.
1 /**
2  * @copyright
3  * ====================================================================
4  * Licensed to the Apache Software Foundation (ASF) under one
5  * or more contributor license agreements. See the NOTICE file
6  * distributed with this work for additional information
7  * regarding copyright ownership. The ASF licenses this file
8  * to you under the Apache License, Version 2.0 (the
9  * "License"); you may not use this file except in compliance
10  * with the License. You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing,
15  * software distributed under the License is distributed on an
16  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  * KIND, either express or implied. See the License for the
18  * specific language governing permissions and limitations
19  * under the License.
20  * ====================================================================
21  * @endcopyright
22  *
23  * @file svn_mergeinfo.h
24  * @brief mergeinfo handling and processing
25  */
26 
27 
28 #ifndef SVN_MERGEINFO_H
29 #define SVN_MERGEINFO_H
30 
31 #include <apr_pools.h>
32 #include <apr_tables.h> /* for apr_array_header_t */
33 #include <apr_hash.h>
34 
35 #include "svn_types.h"
36 #include "svn_string.h" /* for svn_string_t */
37 
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif /* __cplusplus */
42 
43 /** Overview of the @c SVN_PROP_MERGEINFO property.
44  *
45  * Merge history is stored in the @c SVN_PROP_MERGEINFO property of files
46  * and directories. The @c SVN_PROP_MERGEINFO property on a path stores the
47  * complete list of changes merged to that path, either directly or via the
48  * path's parent, grand-parent, etc.. A path may have empty mergeinfo which
49  * means that nothing has been merged to that path or all previous merges
50  * to the path were reversed. Note that a path may have no mergeinfo, this
51  * is not the same as empty mergeinfo.
52  *
53  * Every path in a tree may have @c SVN_PROP_MERGEINFO set, but if the
54  * @c SVN_PROP_MERGEINFO for a path is equivalent to the
55  * @c SVN_PROP_MERGEINFO for its parent, then the @c SVN_PROP_MERGEINFO on
56  * the path will 'elide' (be removed) from the path as a post step to any
57  * merge. If a path's parent does not have any @c SVN_PROP_MERGEINFO set,
58  * the path's mergeinfo can elide to its nearest grand-parent,
59  * great-grand-parent, etc. that has equivalent @c SVN_PROP_MERGEINFO set
60  * on it.
61  *
62  * If a path has no @c SVN_PROP_MERGEINFO of its own, it inherits mergeinfo
63  * from its nearest parent that has @c SVN_PROP_MERGEINFO set. The
64  * exception to this is @c SVN_PROP_MERGEINFO with non-inheritable revision
65  * ranges. These non-inheritable ranges apply only to the path which they
66  * are set on.
67  *
68  * Due to Subversion's allowance for mixed revision working copies, both
69  * elision and inheritance within the working copy presume the path
70  * between a path and its nearest parent with mergeinfo is at the same
71  * working revision. If this is not the case then neither inheritance nor
72  * elision can occur.
73  *
74  * The value of the @c SVN_PROP_MERGEINFO property is either an empty string
75  * (representing empty mergeinfo) or a non-empty string consisting of
76  * a path, a colon, and comma separated revision list, containing one or more
77  * revision or revision ranges. Revision range start and end points are
78  * separated by "-". Revisions and revision ranges may have the optional
79  * @c SVN_MERGEINFO_NONINHERITABLE_STR suffix to signify a non-inheritable
80  * revision/revision range.
81  *
82  * @c SVN_PROP_MERGEINFO Value Grammar:
83  *
84  * Token Definition
85  * ----- ----------
86  * revisionrange REVISION1 "-" REVISION2
87  * revisioneelement (revisionrange | REVISION)"*"?
88  * rangelist revisioneelement (COMMA revisioneelement)*
89  * revisionline PATHNAME COLON rangelist
90  * top "" | (revisionline (NEWLINE revisionline))*
91  *
92  * The PATHNAME is the source of a merge and the rangelist the revision(s)
93  * merged to the path @c SVN_PROP_MERGEINFO is set on directly or indirectly
94  * via inheritance. PATHNAME must always exist at the specified rangelist
95  * and thus a single merge may result in multiple revisionlines if the source
96  * was renamed.
97  *
98  * Rangelists must be sorted from lowest to highest revision and cannot
99  * contain overlapping revisionlistelements. REVISION1 must be less than
100  * REVISION2. Consecutive single revisions that can be represented by a
101  * revisionrange are allowed however (e.g. '5,6,7,8,9-12' or '5-12' are
102  * both acceptable).
103  */
104 
105 /* Suffix for SVN_PROP_MERGEINFO revision ranges indicating a given
106  range is non-inheritable. */
107 #define SVN_MERGEINFO_NONINHERITABLE_STR "*"
108 
109 /** Terminology for data structures that contain mergeinfo.
110  *
111  * Subversion commonly uses several data structures to represent
112  * mergeinfo in RAM:
113  *
114  * (a) Strings (@c svn_string_t *) containing "unparsed mergeinfo".
115  *
116  * (b) A "rangelist". An array (@c apr_array_header_t *) of non-overlapping
117  * merge ranges (@c svn_merge_range_t *), sorted as said by
118  * @c svn_sort_compare_ranges(). An empty range list is represented by
119  * an empty array. Unless specifically noted otherwise, all APIs require
120  * rangelists that describe only forward ranges, i.e. the range's start
121  * revision is less than its end revision.
122  *
123  * (c) @c svn_mergeinfo_t, called "mergeinfo". A hash mapping merge
124  * source paths (@c const char *, starting with slashes) to
125  * non-empty rangelist arrays. A @c NULL hash is used to represent
126  * no mergeinfo and an empty hash is used to represent empty
127  * mergeinfo.
128  *
129  * (d) @c svn_mergeinfo_catalog_t, called a "mergeinfo catalog". A hash
130  * mapping paths (@c const char *) to @c svn_mergeinfo_t.
131  *
132  * Both @c svn_mergeinfo_t and @c svn_mergeinfo_catalog_t are just
133  * typedefs for @c apr_hash_t *; there is no static type-checking, and
134  * you still use standard @c apr_hash_t functions to interact with
135  * them.
136  *
137  * Note that while the keys of mergeinfos are always absolute from the
138  * repository root, the keys of a catalog may be relative to something
139  * else, such as an RA session root.
140  */
141 
142 typedef apr_hash_t *svn_mergeinfo_t;
143 typedef apr_hash_t *svn_mergeinfo_catalog_t;
144 
145 /** Parse the mergeinfo from @a input into @a *mergeinfo. If no
146  * mergeinfo is available, return an empty mergeinfo (never @c NULL).
147  * Perform temporary allocations in @a pool.
148  *
149  * If @a input is not a grammatically correct @c SVN_PROP_MERGEINFO
150  * property, contains overlapping revision ranges of differing
151  * inheritability, or revision ranges with a start revision greater
152  * than or equal to its end revision, or contains paths mapped to empty
153  * revision ranges, then return @c SVN_ERR_MERGEINFO_PARSE_ERROR.
154  * Unordered revision ranges are allowed, but will be sorted when
155  * placed into @a *mergeinfo. Overlapping revision ranges of the same
156  * inheritability are also allowed, but will be combined into a single
157  * range when placed into @a *mergeinfo.
158  *
159  * @a input may contain relative merge source paths, but these are
160  * converted to absolute paths in @a *mergeinfo.
161  *
162  * @since New in 1.5.
163  */
164 svn_error_t *
165 svn_mergeinfo_parse(svn_mergeinfo_t *mergeinfo, const char *input,
166  apr_pool_t *pool);
167 
168 /** Calculate the delta between two mergeinfos, @a mergefrom and @a mergeto
169  * (which may be @c NULL), and place the result in @a *deleted and @a
170  * *added (neither output argument may be @c NULL).
171  *
172  * @a consider_inheritance determines how the rangelists in the two
173  * hashes are compared for equality. If @a consider_inheritance is FALSE,
174  * then the start and end revisions of the @c svn_merge_range_t's being
175  * compared are the only factors considered when determining equality.
176  *
177  * e.g. '/trunk: 1,3-4*,5' == '/trunk: 1,3-5'
178  *
179  * If @a consider_inheritance is TRUE, then the inheritability of the
180  * @c svn_merge_range_t's is also considered and must be the same for two
181  * otherwise identical ranges to be judged equal.
182  *
183  * e.g. '/trunk: 1,3-4*,5' != '/trunk: 1,3-5'
184  * '/trunk: 1,3-4*,5' == '/trunk: 1,3-4*,5'
185  * '/trunk: 1,3-4,5' == '/trunk: 1,3-4,5'
186  *
187  * @since New in 1.5.
188  */
189 svn_error_t *
190 svn_mergeinfo_diff(svn_mergeinfo_t *deleted, svn_mergeinfo_t *added,
191  svn_mergeinfo_t mergefrom, svn_mergeinfo_t mergeto,
192  svn_boolean_t consider_inheritance,
193  apr_pool_t *pool);
194 
195 /** Merge a shallow copy of one mergeinfo, @a changes, into another mergeinfo
196  * @a mergeinfo.
197  *
198  * When intersecting rangelists for a path are merged, the inheritability of
199  * the resulting svn_merge_range_t depends on the inheritability of the
200  * operands. If two non-inheritable ranges are merged the result is always
201  * non-inheritable, in all other cases the resulting range is inheritable.
202  *
203  * e.g. '/A: 1,3-4' merged with '/A: 1,3,4*,5' --> '/A: 1,3-5'
204  * '/A: 1,3-4*' merged with '/A: 1,3,4*,5' --> '/A: 1,3,4*,5'
205  *
206  * @since New in 1.5.
207  */
208 svn_error_t *
209 svn_mergeinfo_merge(svn_mergeinfo_t mergeinfo, svn_mergeinfo_t changes,
210  apr_pool_t *pool);
211 
212 /** Combine one mergeinfo catalog, @a changes_catalog, into another mergeinfo
213  * catalog @a mergeinfo_catalog. If both catalogs have mergeinfo for the same
214  * key, use svn_mergeinfo_merge() to combine the mergeinfos.
215  *
216  * Additions to @a mergeinfo_catalog are deep copies allocated in
217  * @a result_pool. Temporary allocations are made in @a scratch_pool.
218  *
219  * @since New in 1.7.
220  */
221 svn_error_t *
222 svn_mergeinfo_catalog_merge(svn_mergeinfo_catalog_t mergeinfo_catalog,
223  svn_mergeinfo_catalog_t changes_catalog,
224  apr_pool_t *result_pool,
225  apr_pool_t *scratch_pool);
226 
227 /** Like svn_mergeinfo_remove2, but always considers inheritance.
228  *
229  * @deprecated Provided for backward compatibility with the 1.6 API.
230  */
232 svn_error_t *
233 svn_mergeinfo_remove(svn_mergeinfo_t *mergeinfo, svn_mergeinfo_t eraser,
234  svn_mergeinfo_t whiteboard, apr_pool_t *pool);
235 
236 /** Removes @a eraser (the subtrahend) from @a whiteboard (the
237  * minuend), and places the resulting difference in @a *mergeinfo.
238  * Allocates @a *mergeinfo in @a result_pool. Temporary allocations
239  * will be performed in @a scratch_pool.
240  *
241  * @a consider_inheritance determines how to account for the inheritability
242  * of the two mergeinfo's ranges when calculating the range equivalence,
243  * as described for svn_mergeinfo_diff().
244  *
245  * @since New in 1.7.
246  */
247 svn_error_t *
248 svn_mergeinfo_remove2(svn_mergeinfo_t *mergeinfo,
249  svn_mergeinfo_t eraser,
250  svn_mergeinfo_t whiteboard,
251  svn_boolean_t consider_inheritance,
252  apr_pool_t *result_pool,
253  apr_pool_t *scratch_pool);
254 
255 /** Calculate the delta between two rangelists consisting of @c
256  * svn_merge_range_t * elements (sorted in ascending order), @a from
257  * and @a to, and place the result in @a *deleted and @a *added
258  * (neither output argument will ever be @c NULL).
259  *
260  * @a consider_inheritance determines how to account for the inheritability
261  * of the two rangelist's ranges when calculating the diff,
262  * as described for svn_mergeinfo_diff().
263  *
264  * @since New in 1.5.
265  */
266 svn_error_t *
267 svn_rangelist_diff(apr_array_header_t **deleted, apr_array_header_t **added,
268  const apr_array_header_t *from, const apr_array_header_t *to,
269  svn_boolean_t consider_inheritance,
270  apr_pool_t *pool);
271 
272 /** Merge two rangelists consisting of @c svn_merge_range_t *
273  * elements, @a *rangelist and @a changes, placing the results in
274  * @a *rangelist. Either rangelist may be empty.
275  *
276  * When intersecting rangelists are merged, the inheritability of
277  * the resulting svn_merge_range_t depends on the inheritability of the
278  * operands: see svn_mergeinfo_merge().
279  *
280  * Note: @a *rangelist and @a changes must be sorted as said by @c
281  * svn_sort_compare_ranges(). @a *rangelist is guaranteed to remain
282  * in sorted order and be compacted to the minimal number of ranges
283  * needed to represent the merged result.
284  *
285  * @since New in 1.5.
286  */
287 svn_error_t *
288 svn_rangelist_merge(apr_array_header_t **rangelist,
289  const apr_array_header_t *changes,
290  apr_pool_t *pool);
291 
292 /** Removes @a eraser (the subtrahend) from @a whiteboard (the
293  * minuend), and places the resulting difference in @a output.
294  *
295  * Note: @a eraser and @a whiteboard must be sorted as said by @c
296  * svn_sort_compare_ranges(). @a output is guaranteed to be in sorted
297  * order.
298  *
299  * @a consider_inheritance determines how to account for the
300  * @c svn_merge_range_t inheritable field when comparing @a whiteboard's
301  * and @a *eraser's rangelists for equality. @see svn_mergeinfo_diff().
302  *
303  * @since New in 1.5.
304  */
305 svn_error_t *
306 svn_rangelist_remove(apr_array_header_t **output, const apr_array_header_t *eraser,
307  const apr_array_header_t *whiteboard,
308  svn_boolean_t consider_inheritance,
309  apr_pool_t *pool);
310 
311 /** Find the intersection of two mergeinfos, @a mergeinfo1 and @a
312  * mergeinfo2, and place the result in @a *mergeinfo, which is (deeply)
313  * allocated in @a result_pool. Temporary allocations will be performed
314  * in @a scratch_pool.
315  *
316  * @a consider_inheritance determines how to account for the inheritability
317  * of the two mergeinfo's ranges when calculating the range equivalence,
318  * @see svn_rangelist_intersect().
319  *
320  * @since New in 1.7.
321  */
322 svn_error_t *
323 svn_mergeinfo_intersect2(svn_mergeinfo_t *mergeinfo,
324  svn_mergeinfo_t mergeinfo1,
325  svn_mergeinfo_t mergeinfo2,
326  svn_boolean_t consider_inheritance,
327  apr_pool_t *result_pool,
328  apr_pool_t *scratch_pool);
329 
330 /** Like svn_mergeinfo_intersect2, but always considers inheritance.
331  *
332  * @deprecated Provided for backward compatibility with the 1.6 API.
333  */
335 svn_error_t *
336 svn_mergeinfo_intersect(svn_mergeinfo_t *mergeinfo,
337  svn_mergeinfo_t mergeinfo1,
338  svn_mergeinfo_t mergeinfo2,
339  apr_pool_t *pool);
340 
341 /** Find the intersection of two rangelists consisting of @c
342  * svn_merge_range_t * elements, @a rangelist1 and @a rangelist2, and
343  * place the result in @a *rangelist (which is never @c NULL).
344  *
345  * @a consider_inheritance determines how to account for the inheritability
346  * of the two rangelist's ranges when calculating the intersection,
347  * @see svn_mergeinfo_diff(). If @a consider_inheritance is FALSE then
348  * ranges with different inheritance can intersect, but the the resulting
349  * @a *rangelist is non-inheritable only if the corresponding ranges from
350  * both @a rangelist1 and @a rangelist2 are non-inheritable.
351  * If @a consider_inheritance is TRUE, then ranges with different
352  * inheritance can never intersect.
353  *
354  * Note: @a rangelist1 and @a rangelist2 must be sorted as said by @c
355  * svn_sort_compare_ranges(). @a *rangelist is guaranteed to be in sorted
356  * order.
357  * @since New in 1.5.
358  */
359 svn_error_t *
360 svn_rangelist_intersect(apr_array_header_t **rangelist,
361  const apr_array_header_t *rangelist1,
362  const apr_array_header_t *rangelist2,
363  svn_boolean_t consider_inheritance,
364  apr_pool_t *pool);
365 
366 /** Reverse @a rangelist, and the @c start and @c end fields of each
367  * range in @a rangelist, in place.
368  *
369  * TODO(miapi): Is this really a valid function? Rangelists that
370  * aren't sorted, or rangelists containing reverse ranges, are
371  * generally not valid in mergeinfo code. Can we rewrite the two
372  * places where this is used?
373  *
374  * @since New in 1.5.
375  */
376 svn_error_t *
377 svn_rangelist_reverse(apr_array_header_t *rangelist, apr_pool_t *pool);
378 
379 /** Take an array of svn_merge_range_t *'s in @a rangelist, and convert it
380  * back to a text format rangelist in @a output. If @a rangelist contains
381  * no elements, sets @a output to the empty string.
382  *
383  * @since New in 1.5.
384  */
385 svn_error_t *
387  const apr_array_header_t *rangelist,
388  apr_pool_t *pool);
389 
390 /** Return a deep copy of @c svn_merge_range_t *'s in @a rangelist excluding
391  * all non-inheritable @c svn_merge_range_t if @a inheritable is TRUE or
392  * excluding all inheritable @c svn_merge_range_t otherwise. If @a start and
393  * @a end are valid revisions and @a start is less than or equal to @a end,
394  * then exclude only the non-inheritable revision ranges that intersect
395  * inclusively with the range defined by @a start and @a end. If
396  * @a rangelist contains no elements, return an empty array. Allocate the
397  * copy in @a result_pool, use @a scratch_pool for temporary allocations.
398  *
399  * @since New in 1.7.
400  */
401 svn_error_t *
402 svn_rangelist_inheritable2(apr_array_header_t **inheritable_rangelist,
403  const apr_array_header_t *rangelist,
404  svn_revnum_t start,
405  svn_revnum_t end,
406  svn_boolean_t inheritable,
407  apr_pool_t *result_pool,
408  apr_pool_t *scratch_pool);
409 
410 /** Like svn_rangelist_inheritable2, but always finds inheritable ranges.
411  *
412  * @since New in 1.5.
413  * @deprecated Provided for backward compatibility with the 1.6 API.
414  */
416 svn_error_t *
417 svn_rangelist_inheritable(apr_array_header_t **inheritable_rangelist,
418  const apr_array_header_t *rangelist,
419  svn_revnum_t start,
420  svn_revnum_t end,
421  apr_pool_t *pool);
422 
423 /** Return a deep copy of @a mergeinfo, excluding all non-inheritable
424  * @c svn_merge_range_t if @a inheritable is TRUE or excluding all
425  * inheritable @c svn_merge_range_t otherwise. If @a start and @a end
426  * are valid revisions and @a start is less than or equal to @a end,
427  * then exclude only the non-inheritable revisions that intersect
428  * inclusively with the range defined by @a start and @a end. If @a path
429  * is not NULL remove non-inheritable ranges only for @a path. If all
430  * ranges are removed for a given path then remove that path as well.
431  * If all paths are removed or @a rangelist is empty then set
432  * @a *inheritable_rangelist to an empty array. Allocate the copy in
433  * @a result_pool, use @a scratch_pool for temporary allocations.
434  *
435  * @since New in 1.7.
436  */
437 svn_error_t *
438 svn_mergeinfo_inheritable2(svn_mergeinfo_t *inheritable_mergeinfo,
439  svn_mergeinfo_t mergeinfo,
440  const char *path,
441  svn_revnum_t start,
442  svn_revnum_t end,
443  svn_boolean_t inheritable,
444  apr_pool_t *result_pool,
445  apr_pool_t *scratch_pool);
446 
447 /** Like svn_mergeinfo_inheritable2, but always finds inheritable mergeinfo.
448  *
449  * @since New in 1.5.
450  * @deprecated Provided for backward compatibility with the 1.6 API.
451  */
453 svn_error_t *
454 svn_mergeinfo_inheritable(svn_mergeinfo_t *inheritable_mergeinfo,
455  svn_mergeinfo_t mergeinfo,
456  const char *path,
457  svn_revnum_t start,
458  svn_revnum_t end,
459  apr_pool_t *pool);
460 
461 /** Take a mergeinfo in @a mergeinput, and convert it to unparsed
462  * mergeinfo. Set @a *output to the result, allocated in @a pool.
463  * If @a input contains no elements, set @a *output to the empty string.
464  *
465  * @a mergeinput may contain relative merge source paths, but these are
466  * converted to absolute paths in @a *output.
467  *
468  * @since New in 1.5.
469 */
470 svn_error_t *
472  svn_mergeinfo_t mergeinput,
473  apr_pool_t *pool);
474 
475 /** Take a hash of mergeinfo in @a mergeinfo, and sort the rangelists
476  * associated with each key (in place).
477  *
478  * TODO(miapi): mergeinfos should *always* be sorted. This should be
479  * a private function.
480  *
481  * @since New in 1.5
482  */
483 svn_error_t *
484 svn_mergeinfo_sort(svn_mergeinfo_t mergeinfo, apr_pool_t *pool);
485 
486 /** Return a deep copy of @a mergeinfo_catalog, allocated in @a pool.
487  *
488  * @since New in 1.6.
489  */
490 svn_mergeinfo_catalog_t
491 svn_mergeinfo_catalog_dup(svn_mergeinfo_catalog_t mergeinfo_catalog,
492  apr_pool_t *pool);
493 
494 /** Return a deep copy of @a mergeinfo, allocated in @a pool.
495  *
496  * @since New in 1.5.
497  */
498 svn_mergeinfo_t
499 svn_mergeinfo_dup(svn_mergeinfo_t mergeinfo, apr_pool_t *pool);
500 
501 /** Return a deep copy of @a rangelist, allocated in @a pool.
502  *
503  * @since New in 1.5.
504  */
505 apr_array_header_t *
506 svn_rangelist_dup(const apr_array_header_t *rangelist, apr_pool_t *pool);
507 
508 
509 /**
510  * The three ways to request mergeinfo affecting a given path.
511  *
512  * @since New in 1.5.
513  */
515 {
516  /** Explicit mergeinfo only. */
518 
519  /** Explicit mergeinfo, or if that doesn't exist, the inherited
520  mergeinfo from a target's nearest (path-wise, not history-wise)
521  ancestor. */
523 
524  /** Mergeinfo on target's nearest (path-wise, not history-wise)
525  ancestor, regardless of whether target has explicit mergeinfo. */
528 
529 /** Return a constant string expressing @a inherit as an English word,
530  * i.e., "explicit" (default), "inherited", or "nearest_ancestor".
531  * The string is not localized, as it may be used for client<->server
532  * communications.
533  *
534  * @since New in 1.5.
535  */
536 const char *
538 
539 
540 /** Return the appropriate @c svn_mergeinfo_inheritance_t for @a word.
541  * @a word is as returned from svn_inheritance_to_word(). Defaults to
542  * @c svn_mergeinfo_explicit.
543  *
544  * @since New in 1.5.
545  */
547 svn_inheritance_from_word(const char *word);
548 
549 
550 #ifdef __cplusplus
551 }
552 #endif /* __cplusplus */
553 
554 #endif /* SVN_MERGEINFO_H */
Counted-length strings for Subversion, plus some C string goodies.
svn_error_t * svn_rangelist_to_string(svn_string_t **output, const apr_array_header_t *rangelist, apr_pool_t *pool)
Take an array of svn_merge_range_t *&#39;s in rangelist, and convert it back to a text format rangelist i...
apr_hash_t * svn_mergeinfo_t
Terminology for data structures that contain mergeinfo.
svn_error_t * svn_rangelist_inheritable(apr_array_header_t **inheritable_rangelist, const apr_array_header_t *rangelist, svn_revnum_t start, svn_revnum_t end, apr_pool_t *pool)
Like svn_rangelist_inheritable2, but always finds inheritable ranges.
svn_error_t * svn_mergeinfo_catalog_merge(svn_mergeinfo_catalog_t mergeinfo_catalog, svn_mergeinfo_catalog_t changes_catalog, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Combine one mergeinfo catalog, changes_catalog, into another mergeinfo catalog mergeinfo_catalog.
Explicit mergeinfo only.
svn_mergeinfo_inheritance_t
The three ways to request mergeinfo affecting a given path.
Mergeinfo on target&#39;s nearest (path-wise, not history-wise) ancestor, regardless of whether target ha...
svn_error_t * svn_mergeinfo_intersect(svn_mergeinfo_t *mergeinfo, svn_mergeinfo_t mergeinfo1, svn_mergeinfo_t mergeinfo2, apr_pool_t *pool)
Like svn_mergeinfo_intersect2, but always considers inheritance.
A simple counted string.
Definition: svn_string.h:96
svn_error_t * svn_rangelist_inheritable2(apr_array_header_t **inheritable_rangelist, const apr_array_header_t *rangelist, svn_revnum_t start, svn_revnum_t end, svn_boolean_t inheritable, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Return a deep copy of svn_merge_range_t *&#39;s in rangelist excluding all non-inheritable svn_merge_rang...
svn_error_t * svn_mergeinfo_diff(svn_mergeinfo_t *deleted, svn_mergeinfo_t *added, svn_mergeinfo_t mergefrom, svn_mergeinfo_t mergeto, svn_boolean_t consider_inheritance, apr_pool_t *pool)
Calculate the delta between two mergeinfos, mergefrom and mergeto (which may be NULL), and place the result in *deleted and *added (neither output argument may be NULL).
apr_array_header_t * svn_rangelist_dup(const apr_array_header_t *rangelist, apr_pool_t *pool)
Return a deep copy of rangelist, allocated in pool.
const char * svn_inheritance_to_word(svn_mergeinfo_inheritance_t inherit)
Return a constant string expressing inherit as an English word, i.e., &quot;explicit&quot; (default), &quot;inherited&quot;, or &quot;nearest_ancestor&quot;.
Subversion error object.
Definition: svn_types.h:90
svn_error_t * svn_mergeinfo_parse(svn_mergeinfo_t *mergeinfo, const char *input, apr_pool_t *pool)
Parse the mergeinfo from input into *mergeinfo.
Explicit mergeinfo, or if that doesn&#39;t exist, the inherited mergeinfo from a target&#39;s nearest (path-w...
svn_error_t * svn_mergeinfo_merge(svn_mergeinfo_t mergeinfo, svn_mergeinfo_t changes, apr_pool_t *pool)
Merge a shallow copy of one mergeinfo, changes, into another mergeinfo mergeinfo. ...
svn_error_t * svn_rangelist_reverse(apr_array_header_t *rangelist, apr_pool_t *pool)
Reverse rangelist, and the start and end fields of each range in rangelist, in place.
svn_error_t * svn_mergeinfo_inheritable(svn_mergeinfo_t *inheritable_mergeinfo, svn_mergeinfo_t mergeinfo, const char *path, svn_revnum_t start, svn_revnum_t end, apr_pool_t *pool)
Like svn_mergeinfo_inheritable2, but always finds inheritable mergeinfo.
svn_mergeinfo_catalog_t svn_mergeinfo_catalog_dup(svn_mergeinfo_catalog_t mergeinfo_catalog, apr_pool_t *pool)
Return a deep copy of mergeinfo_catalog, allocated in pool.
Subversion&#39;s data types.
#define SVN_DEPRECATED
Macro used to mark deprecated functions.
Definition: svn_types.h:58
svn_error_t * svn_mergeinfo_to_string(svn_string_t **output, svn_mergeinfo_t mergeinput, apr_pool_t *pool)
Take a mergeinfo in mergeinput, and convert it to unparsed mergeinfo.
svn_error_t * svn_mergeinfo_inheritable2(svn_mergeinfo_t *inheritable_mergeinfo, svn_mergeinfo_t mergeinfo, const char *path, svn_revnum_t start, svn_revnum_t end, svn_boolean_t inheritable, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Return a deep copy of mergeinfo, excluding all non-inheritable svn_merge_range_t if inheritable is TR...
long int svn_revnum_t
About Special Files in Subversion.
Definition: svn_types.h:297
svn_error_t * svn_rangelist_diff(apr_array_header_t **deleted, apr_array_header_t **added, const apr_array_header_t *from, const apr_array_header_t *to, svn_boolean_t consider_inheritance, apr_pool_t *pool)
Calculate the delta between two rangelists consisting of svn_merge_range_t * elements (sorted in asce...
svn_error_t * svn_rangelist_remove(apr_array_header_t **output, const apr_array_header_t *eraser, const apr_array_header_t *whiteboard, svn_boolean_t consider_inheritance, apr_pool_t *pool)
Removes eraser (the subtrahend) from whiteboard (the minuend), and places the resulting difference in...
svn_error_t * svn_mergeinfo_remove2(svn_mergeinfo_t *mergeinfo, svn_mergeinfo_t eraser, svn_mergeinfo_t whiteboard, svn_boolean_t consider_inheritance, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Removes eraser (the subtrahend) from whiteboard (the minuend), and places the resulting difference in...
svn_mergeinfo_t svn_mergeinfo_dup(svn_mergeinfo_t mergeinfo, apr_pool_t *pool)
Return a deep copy of mergeinfo, allocated in pool.
svn_mergeinfo_inheritance_t svn_inheritance_from_word(const char *word)
Return the appropriate svn_mergeinfo_inheritance_t for word.
svn_error_t * svn_rangelist_merge(apr_array_header_t **rangelist, const apr_array_header_t *changes, apr_pool_t *pool)
Merge two rangelists consisting of svn_merge_range_t * elements, *rangelist and changes, placing the results in *rangelist.
svn_error_t * svn_mergeinfo_sort(svn_mergeinfo_t mergeinfo, apr_pool_t *pool)
Take a hash of mergeinfo in mergeinfo, and sort the rangelists associated with each key (in place)...
int svn_boolean_t
YABT: Yet Another Boolean Type.
Definition: svn_types.h:360
svn_error_t * svn_rangelist_intersect(apr_array_header_t **rangelist, const apr_array_header_t *rangelist1, const apr_array_header_t *rangelist2, svn_boolean_t consider_inheritance, apr_pool_t *pool)
Find the intersection of two rangelists consisting of svn_merge_range_t * elements, rangelist1 and rangelist2, and place the result in *rangelist (which is never NULL).
svn_error_t * svn_mergeinfo_remove(svn_mergeinfo_t *mergeinfo, svn_mergeinfo_t eraser, svn_mergeinfo_t whiteboard, apr_pool_t *pool)
Like svn_mergeinfo_remove2, but always considers inheritance.
svn_error_t * svn_mergeinfo_intersect2(svn_mergeinfo_t *mergeinfo, svn_mergeinfo_t mergeinfo1, svn_mergeinfo_t mergeinfo2, svn_boolean_t consider_inheritance, apr_pool_t *result_pool, apr_pool_t *scratch_pool)
Find the intersection of two mergeinfos, mergeinfo1 and mergeinfo2, and place the result in *mergeinf...