[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH][merge-tracking]api cleanup of get_merge_info_for_path

From: Kamesh Jayachandran <kamesh_at_collab.net>
Date: 2006-10-07 21:10:24 CEST

Hi All,
Find the attached patch/log.

With regards
Kamesh Jayachandran

[[[
Patch by: Kamesh Jayachandran <kamesh@collab.net>

We can signal 'get_merge_info_for_path' whether to set the result by
passing it or NULL rather than one more duplicate parameter 'setresult'.

* subversion/libsvn_fs_util/merge-info-sqlite-index.c
  (get_merge_info_for_path):
   Improve the DOCString.
   Remove 'setresult' parameter as 'result' additionally can be used for the
   same purpose.
   Calls get_merge_info_for_path with the new api convention.
  (svn_fs_merge_info__get_merge_info):
   Calls get_merge_info_for_path with the new api convention.
   
]]]

Index: subversion/libsvn_fs_util/merge-info-sqlite-index.c
===================================================================
--- subversion/libsvn_fs_util/merge-info-sqlite-index.c (revision 21795)
+++ subversion/libsvn_fs_util/merge-info-sqlite-index.c (working copy)
@@ -392,14 +392,15 @@
 }
 
 /* Helper for get_merge_info that will recursively get merge info for
- a single path. */
+ * a single path.
+ * Pass RESULT as NULL if you do not want the result to be updated.
+ */
 static svn_error_t *
 get_merge_info_for_path(sqlite3 *db,
                         const char *path,
                         svn_revnum_t rev,
                         apr_hash_t *result,
                         apr_hash_t *cache,
- svn_boolean_t setresult,
                         svn_boolean_t include_parents,
                         apr_pool_t *pool)
 {
@@ -412,7 +413,7 @@
   cacheresult = apr_hash_get(cache, path, APR_HASH_KEY_STRING);
   if (cacheresult != 0)
     {
- if (cacheresult != NEGATIVE_CACHE_RESULT && setresult)
+ if (cacheresult != NEGATIVE_CACHE_RESULT && result)
         apr_hash_set(result, path, APR_HASH_KEY_STRING, cacheresult);
       return SVN_NO_ERROR;
     }
@@ -442,7 +443,7 @@
       SVN_ERR(parse_mergeinfo_from_db(db, path, rev, &pathresult, pool));
       if (pathresult)
         {
- if (setresult)
+ if (result)
             apr_hash_set(result, path, APR_HASH_KEY_STRING, pathresult);
           apr_hash_set(cache, path, APR_HASH_KEY_STRING, pathresult);
         }
@@ -470,9 +471,9 @@
         parentpath->data = "";
 
       SVN_ERR(get_merge_info_for_path(db, parentpath->data, rev,
- result, cache, FALSE, include_parents,
+ NULL, cache, include_parents,
                                       pool));
- if (setresult)
+ if (result)
         {
           /* Now translate the result for our parent to our path */
           cacheresult = apr_hash_get(cache, parentpath->data,
@@ -534,8 +535,8 @@
       const char *path = APR_ARRAY_IDX(paths, i, const char *);
 
       SVN_ERR (get_merge_info_for_path (db, path, rev, *mergeinfo,
- mergeinfo_cache, TRUE,
- include_parents, pool));
+ mergeinfo_cache, include_parents,
+ pool));
     }
 
   for (i = 0; i < paths->nelts; i++)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 7 21:09:49 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.