subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1569815 - in /subversion/trunk/subversion: include/svn_mergeinfo.h libsvn_subr/mergeinfo.c
Date Wed, 19 Feb 2014 16:31:50 GMT
Author: julianfoad
Date: Wed Feb 19 16:31:49 2014
New Revision: 1569815

URL: http://svn.apache.org/r1569815
Log:
Simplify code and improve doc strings.

* subversion/include/svn_mergeinfo.h
  (svn_rangelist_inheritable2,
   svn_mergeinfo_inheritable2): Improve doc strings.

* subversion/libsvn_subr/mergeinfo.c
  (svn_rangelist_inheritable2): Simplify code. Fix comments.

Modified:
    subversion/trunk/subversion/include/svn_mergeinfo.h
    subversion/trunk/subversion/libsvn_subr/mergeinfo.c

Modified: subversion/trunk/subversion/include/svn_mergeinfo.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_mergeinfo.h?rev=1569815&r1=1569814&r2=1569815&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_mergeinfo.h (original)
+++ subversion/trunk/subversion/include/svn_mergeinfo.h Wed Feb 19 16:31:49 2014
@@ -446,14 +446,21 @@ svn_rangelist_to_string(svn_string_t **o
                         const svn_rangelist_t *rangelist,
                         apr_pool_t *pool);
 
-/** Return a deep copy of @c svn_merge_range_t *'s in @a rangelist excluding
+/** Remove non-inheritable or inheritable revision ranges from a rangelist.
+ *
+ * Set @a *inheritable_rangelist to a deep copy of @a rangelist, excluding
  * all non-inheritable @c svn_merge_range_t if @a inheritable is TRUE or
- * excluding all inheritable @c svn_merge_range_t otherwise.  If @a start and
- * @a end are valid revisions and @a start is less than or equal to @a end,
- * then exclude only the non-inheritable revision ranges that intersect
- * inclusively with the range defined by @a start and @a end.  If
- * @a rangelist contains no elements, return an empty array.  Allocate the
- * copy in @a result_pool, use @a scratch_pool for temporary allocations.
+ * excluding all inheritable @c svn_merge_range_t otherwise.
+ *
+ * If @a start and @a end are valid revisions and @a start is less than or
+ * equal to @a end, then exclude only the (non-inheritable or inheritable)
+ * revision ranges that intersect inclusively with the range defined by
+ * @a start and @a end.
+ *
+ * If there are no remaining ranges, return an empty array.
+ *
+ * Allocate the copy in @a result_pool, and use @a scratch_pool for
+ * temporary allocations.
  *
  * @since New in 1.7.
  */
@@ -479,17 +486,26 @@ svn_rangelist_inheritable(svn_rangelist_
                           svn_revnum_t end,
                           apr_pool_t *pool);
 
-/** Return a deep copy of @a mergeinfo, excluding all non-inheritable
- * @c svn_merge_range_t if @a inheritable is TRUE or excluding all
- * inheritable @c svn_merge_range_t otherwise.  If @a start and @a end
- * are valid revisions and @a start is less than or equal to @a end,
- * then exclude only the non-inheritable revisions that intersect
- * inclusively with the range defined by @a start and @a end.  If @a path
- * is not NULL remove non-inheritable ranges only for @a path.  If all
- * ranges are removed for a given path then remove that path as well.
- * If all paths are removed or @a rangelist is empty then set
- * @a *inheritable_rangelist to an empty array.  Allocate the copy in
- * @a result_pool, use @a scratch_pool for temporary allocations.
+/** Remove non-inheritable or inheritable revision ranges from mergeinfo.
+ *
+ * Set @a *inheritable_mergeinfo to a deep copy of @a mergeinfo, excluding
+ * all non-inheritable @c svn_merge_range_t if @a inheritable is TRUE or
+ * excluding all inheritable @c svn_merge_range_t otherwise.
+ *
+ * If @a start and @a end are valid revisions and @a start is less than or
+ * equal to @a end, then exclude only the (non-inheritable or inheritable)
+ * revisions that intersect inclusively with the range defined by @a start
+ * and @a end.
+ *
+ * If @a path is not NULL remove (non-inheritable or inheritable) ranges
+ * only for @a path.
+ *
+ * If all ranges are removed for a given path then remove that path as well.
+ * If @a mergeinfo is initially empty or all paths are removed from it then
+ * set @a *inheritable_mergeinfo to an empty mergeinfo.
+ *
+ * Allocate the copy in @a result_pool, and use @a scratch_pool for
+ * temporary allocations.
  *
  * @since New in 1.7.
  */

Modified: subversion/trunk/subversion/libsvn_subr/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/mergeinfo.c?rev=1569815&r1=1569814&r2=1569815&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_subr/mergeinfo.c Wed Feb 19 16:31:49 2014
@@ -2099,28 +2099,24 @@ svn_rangelist_inheritable2(svn_rangelist
           || !SVN_IS_VALID_REVNUM(end)
           || end < start)
         {
+          /* We want all (non-inheritable or inheritable) ranges removed. */
           int i;
-          /* We want all non-inheritable ranges removed. */
+
           for (i = 0; i < rangelist->nelts; i++)
             {
               svn_merge_range_t *range = APR_ARRAY_IDX(rangelist, i,
                                                        svn_merge_range_t *);
               if (range->inheritable == inheritable)
                 {
-                  svn_merge_range_t *inheritable_range =
-                    apr_palloc(result_pool, sizeof(*inheritable_range));
-                  inheritable_range->start = range->start;
-                  inheritable_range->end = range->end;
-                  inheritable_range->inheritable = range->inheritable;
-                  APR_ARRAY_PUSH(*inheritable_rangelist,
-                                 svn_merge_range_t *) = inheritable_range;
+                  APR_ARRAY_PUSH(*inheritable_rangelist, svn_merge_range_t *)
+                    = svn_merge_range_dup(range, result_pool);
                 }
             }
         }
       else
         {
-          /* We want only the non-inheritable ranges bound by START
-             and END removed. */
+          /* We want only the (non-inheritable or inheritable) ranges
+             bound by START and END removed. */
           svn_rangelist_t *ranges_inheritable =
             svn_rangelist__initialize(start, end, inheritable, scratch_pool);
 



Mime
View raw message