subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From julianf...@apache.org
Subject svn commit: r1569803 - in /subversion/trunk/subversion: include/private/svn_mergeinfo_private.h include/svn_mergeinfo.h libsvn_client/mergeinfo.h libsvn_subr/mergeinfo.c
Date Wed, 19 Feb 2014 16:05:03 GMT
Author: julianfoad
Date: Wed Feb 19 16:05:03 2014
New Revision: 1569803

URL: http://svn.apache.org/r1569803
Log:
Clarify some pool usage by tweaking doc strings and renaming pool
parameters.

* subversion/include/private/svn_mergeinfo_private.h
  (svn_mergeinfo__remove_empty_rangelists): Rename the pool parameter to
    'scratch_pool' and remove the (too-specific) mention of it from the doc
    string since it's now obvious.

* subversion/include/svn_mergeinfo.h
  (svn_mergeinfo_parse): Document that the result is allocated deeply in the
    pool, since it is and apparently always has been.

* subversion/libsvn_client/mergeinfo.h
  (svn_client__parse_mergeinfo): Same.

* subversion/libsvn_subr/mergeinfo.c
  (parse_revision_line, parse_top): Document the basic purpose and the pool
    usage.
  (svn_mergeinfo__remove_empty_rangelists): Rename the pool parameter as
    mentioned above.

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

Modified: subversion/trunk/subversion/include/private/svn_mergeinfo_private.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_mergeinfo_private.h?rev=1569803&r1=1569802&r2=1569803&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_mergeinfo_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_mergeinfo_private.h Wed Feb 19 16:05:03
2014
@@ -98,13 +98,13 @@ svn_mergeinfo__equals(svn_boolean_t *is_
                       svn_boolean_t consider_inheritance,
                       apr_pool_t *pool);
 
-/* Examine MERGEINFO, removing all paths from the hash which map to
-   empty rangelists.  POOL is used only to allocate the apr_hash_index_t
-   iterator.  Returns TRUE if any paths were removed and FALSE if none were
+/* Remove all paths from MERGEINFO which map to empty rangelists.
+
+   Return TRUE if any paths were removed and FALSE if none were
    removed or MERGEINFO is NULL. */
 svn_boolean_t
 svn_mergeinfo__remove_empty_rangelists(svn_mergeinfo_t mergeinfo,
-                                       apr_pool_t *pool);
+                                       apr_pool_t *scratch_pool);
 
 /* Make a shallow (ie, mergeinfos are not duped, or altered at all;
    keys share storage) copy of IN_CATALOG in *OUT_CATALOG, removing

Modified: subversion/trunk/subversion/include/svn_mergeinfo.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_mergeinfo.h?rev=1569803&r1=1569802&r2=1569803&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_mergeinfo.h (original)
+++ subversion/trunk/subversion/include/svn_mergeinfo.h Wed Feb 19 16:05:03 2014
@@ -145,7 +145,6 @@ typedef apr_hash_t *svn_mergeinfo_catalo
 
 /** Parse the mergeinfo from @a input into @a *mergeinfo.  If no
  * mergeinfo is available, return an empty mergeinfo (never @c NULL).
- * Perform temporary allocations in @a pool.
  *
  * If @a input is not a grammatically correct @c SVN_PROP_MERGEINFO
  * property, contains overlapping revision ranges of differing
@@ -160,6 +159,9 @@ typedef apr_hash_t *svn_mergeinfo_catalo
  * @a input may contain relative merge source paths, but these are
  * converted to absolute paths in @a *mergeinfo.
  *
+ * Allocate the result deeply in @a pool. Also perform temporary
+ * allocations in @a pool.
+ *
  * @since New in 1.5.
  */
 svn_error_t *

Modified: subversion/trunk/subversion/libsvn_client/mergeinfo.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/mergeinfo.h?rev=1569803&r1=1569802&r2=1569803&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/mergeinfo.h (original)
+++ subversion/trunk/subversion/libsvn_client/mergeinfo.h Wed Feb 19 16:05:03 2014
@@ -316,7 +316,9 @@ svn_client__get_history_as_mergeinfo(svn
 
 /* Parse any explicit mergeinfo on LOCAL_ABSPATH and store it in
    *MERGEINFO.  If no record of any mergeinfo exists, set *MERGEINFO to NULL.
-   Does not acount for inherited mergeinfo. */
+   Does not acount for inherited mergeinfo.
+
+   Allocate the result deeply in @a result_pool. */
 svn_error_t *
 svn_client__parse_mergeinfo(svn_mergeinfo_t *mergeinfo,
                             svn_wc_context_t *wc_ctx,

Modified: subversion/trunk/subversion/libsvn_subr/mergeinfo.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/mergeinfo.c?rev=1569803&r1=1569802&r2=1569803&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/mergeinfo.c (original)
+++ subversion/trunk/subversion/libsvn_subr/mergeinfo.c Wed Feb 19 16:05:03 2014
@@ -677,7 +677,11 @@ svn_rangelist__combine_adjacent_ranges(s
   return SVN_NO_ERROR;
 }
 
-/* revisionline -> PATHNAME COLON revisionlist */
+/* revisionline -> PATHNAME COLON revisionlist
+ *
+ * Parse one line of mergeinfo starting at INPUT, not reading beyond END,
+ * into HASH. Allocate the new entry in HASH deeply from HASH's pool.
+ */
 static svn_error_t *
 parse_revision_line(const char **input, const char *end, svn_mergeinfo_t hash,
                     apr_pool_t *scratch_pool)
@@ -740,12 +744,16 @@ parse_revision_line(const char **input, 
   return SVN_NO_ERROR;
 }
 
-/* top -> revisionline (NEWLINE revisionline)*  */
+/* top -> revisionline (NEWLINE revisionline)*
+ *
+ * Parse mergeinfo starting at INPUT, not reading beyond END, into HASH.
+ * Allocate all the new entries in HASH deeply from HASH's pool.
+ */
 static svn_error_t *
 parse_top(const char **input, const char *end, svn_mergeinfo_t hash,
-          apr_pool_t *pool)
+          apr_pool_t *scratch_pool)
 {
-  apr_pool_t *iterpool = svn_pool_create(pool);
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
   while (*input < end)
     {
@@ -2129,14 +2137,15 @@ svn_rangelist_inheritable2(svn_rangelist
 
 svn_boolean_t
 svn_mergeinfo__remove_empty_rangelists(svn_mergeinfo_t mergeinfo,
-                                       apr_pool_t *pool)
+                                       apr_pool_t *scratch_pool)
 {
   apr_hash_index_t *hi;
   svn_boolean_t removed_some_ranges = FALSE;
 
   if (mergeinfo)
     {
-      for (hi = apr_hash_first(pool, mergeinfo); hi; hi = apr_hash_next(hi))
+      for (hi = apr_hash_first(scratch_pool, mergeinfo); hi;
+           hi = apr_hash_next(hi))
         {
           const char *path = svn__apr_hash_index_key(hi);
           svn_rangelist_t *rangelist = svn__apr_hash_index_val(hi);



Mime
View raw message