subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stef...@apache.org
Subject svn commit: r1730394 - /subversion/trunk/subversion/libsvn_repos/log.c
Date Sun, 14 Feb 2016 20:19:52 GMT
Author: stefan2
Date: Sun Feb 14 20:19:52 2016
New Revision: 1730394

URL: http://svn.apache.org/viewvc?rev=1730394&view=rev
Log:
Continue work on the svn_repos_get_logs4 to svn_repos_get_logs5 migration.

Remove the support for "prefetched" change lists as it was only ever
effective when running 'log -g' where it prevented fetching the hash
a second time.  With the new log API, this is much less of a performance
issue, plus we have the option of an early out by not even reading all
entries once we found an "interesting" one.

* subversion/libsvn_repos/log.c
  (detect_changed,
   fs_mergeinfo_changed): Drop the PREFETCHED_CHANGES parameter and simply
                          always fetch the changes.
  (get_combined_mergeinfo_changes,
   fill_log_entry,
   send_log): Remove the PREFETCHED_CHANGES pass-through parameter.
  (do_logs): Remove CHANGES re-use logic.
  (svn_repos__get_logs5): Update caller.

Modified:
    subversion/trunk/subversion/libsvn_repos/log.c

Modified: subversion/trunk/subversion/libsvn_repos/log.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/log.c?rev=1730394&r1=1730393&r2=1730394&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/log.c (original)
+++ subversion/trunk/subversion/libsvn_repos/log.c Sun Feb 14 20:19:52 2016
@@ -169,10 +169,6 @@ svn_repos_check_revision_access(svn_repo
  * The CHANGED hash set and its keys and values are allocated in POOL;
  * keys are const char * paths and values are svn_log_changed_path_t.
  *
- * To prevent changes from being processed over and over again, the
- * changed paths for ROOT may be passed in PREFETCHED_CHANGES.  If the
- * latter is NULL, we will request the list inside this function.
- *
  * If optional AUTHZ_READ_FUNC is non-NULL, then use it (with
  * AUTHZ_READ_BATON and FS) to check whether each changed-path (and
  * copyfrom_path) is readable:
@@ -196,12 +192,11 @@ detect_changed(svn_repos_revision_access
                apr_hash_t **changed,
                svn_fs_root_t *root,
                svn_fs_t *fs,
-               apr_hash_t *prefetched_changes,
                svn_repos_authz_func_t authz_read_func,
                void *authz_read_baton,
                apr_pool_t *pool)
 {
-  apr_hash_t *changes = prefetched_changes;
+  apr_hash_t *changes;
   apr_hash_index_t *hi;
   apr_pool_t *iterpool;
   svn_boolean_t found_readable = FALSE;
@@ -210,21 +205,14 @@ detect_changed(svn_repos_revision_access
   /* If we create the CHANGES hash ourselves, we can reuse it as the
    * result hash as it contains the exact same keys - but with _all_
    * values being replaced by structs of a different type. */
-  if (changes == NULL)
-    {
-      SVN_ERR(svn_fs_paths_changed2(&changes, root, pool));
+  SVN_ERR(svn_fs_paths_changed2(&changes, root, pool));
 
-      /* If we are going to filter the results, we won't use the exact
-       * same keys but put them into a new hash. */
-      if (authz_read_func)
-        *changed = svn_hash__make(pool);
-      else
-        *changed = changes;
-    }
+  /* If we are going to filter the results, we won't use the exact
+    * same keys but put them into a new hash. */
+  if (authz_read_func)
+    *changed = svn_hash__make(pool);
   else
-    {
-      *changed = svn_hash__make(pool);
-    }
+    *changed = changes;
 
   if (apr_hash_count(changes) == 0)
     {
@@ -602,15 +590,12 @@ next_history_rev(const apr_array_header_
 
 /* Set *DELETED_MERGEINFO_CATALOG and *ADDED_MERGEINFO_CATALOG to
    catalogs describing how mergeinfo values on paths (which are the
-   keys of those catalogs) were changed in REV.  If *PREFETCHED_CHANGES
-   already contains the changed paths for REV, use that.  Otherwise,
-   request that data and return it in *PREFETCHED_CHANGES. */
+   keys of those catalogs) were changed in REV. */
 /* ### TODO: This would make a *great*, useful public function,
    ### svn_repos_fs_mergeinfo_changed()!  -- cmpilato  */
 static svn_error_t *
 fs_mergeinfo_changed(svn_mergeinfo_catalog_t *deleted_mergeinfo_catalog,
                      svn_mergeinfo_catalog_t *added_mergeinfo_catalog,
-                     apr_hash_t **prefetched_changes,
                      svn_fs_t *fs,
                      svn_revnum_t rev,
                      apr_pool_t *result_pool,
@@ -621,6 +606,7 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
   apr_hash_index_t *hi;
   svn_boolean_t any_mergeinfo = FALSE;
   svn_boolean_t any_copy = FALSE;
+  apr_hash_t *changes;
 
   /* Initialize return variables. */
   *deleted_mergeinfo_catalog = svn_hash__make(result_pool);
@@ -633,12 +619,11 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
   /* We're going to use the changed-paths information for REV to
      narrow down our search. */
   SVN_ERR(svn_fs_revision_root(&root, fs, rev, scratch_pool));
-  if (*prefetched_changes == NULL)
-    SVN_ERR(svn_fs_paths_changed2(prefetched_changes, root, scratch_pool));
+  SVN_ERR(svn_fs_paths_changed2(&changes, root, scratch_pool));
 
   /* Look for copies and (potential) mergeinfo changes.
      We will use both flags to take shortcuts further down the road. */
-  for (hi = apr_hash_first(scratch_pool, *prefetched_changes);
+  for (hi = apr_hash_first(scratch_pool, changes);
        hi;
        hi = apr_hash_next(hi))
     {
@@ -669,7 +654,7 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
      svn:mergeinfo change and is one of our paths of interest, or a
      child or [grand]parent directory thereof. */
   iterpool = svn_pool_create(scratch_pool);
-  for (hi = apr_hash_first(scratch_pool, *prefetched_changes);
+  for (hi = apr_hash_first(scratch_pool, changes);
        hi;
        hi = apr_hash_next(hi))
     {
@@ -855,14 +840,10 @@ fs_mergeinfo_changed(svn_mergeinfo_catal
 
 /* Determine what (if any) mergeinfo for PATHS was modified in
    revision REV, returning the differences for added mergeinfo in
-   *ADDED_MERGEINFO and deleted mergeinfo in *DELETED_MERGEINFO.
-   If *PREFETCHED_CHANGES already contains the changed paths for
-   REV, use that.  Otherwise, request that data and return it in
-   *PREFETCHED_CHANGES. */
+   *ADDED_MERGEINFO and deleted mergeinfo in *DELETED_MERGEINFO. */
 static svn_error_t *
 get_combined_mergeinfo_changes(svn_mergeinfo_t *added_mergeinfo,
                                svn_mergeinfo_t *deleted_mergeinfo,
-                               apr_hash_t **prefetched_changes,
                                svn_fs_t *fs,
                                const apr_array_header_t *paths,
                                svn_revnum_t rev,
@@ -891,7 +872,6 @@ get_combined_mergeinfo_changes(svn_merge
   /* Fetch the mergeinfo changes for REV. */
   err = fs_mergeinfo_changed(&deleted_mergeinfo_catalog,
                              &added_mergeinfo_catalog,
-                             prefetched_changes,
                              fs, rev,
                              scratch_pool, scratch_pool);
   if (err)
@@ -1083,7 +1063,6 @@ static svn_error_t *
 fill_log_entry(svn_log_entry_t *log_entry,
                svn_revnum_t rev,
                svn_fs_t *fs,
-               apr_hash_t *prefetched_changes,
                svn_boolean_t discover_changed_paths,
                const apr_array_header_t *revprops,
                svn_repos_authz_func_t authz_read_func,
@@ -1103,10 +1082,8 @@ fill_log_entry(svn_log_entry_t *log_entr
       svn_repos_revision_access_level_t access_level;
 
       SVN_ERR(svn_fs_revision_root(&newroot, fs, rev, pool));
-      SVN_ERR(detect_changed(&access_level, &changed_paths,
-                             newroot, fs, prefetched_changes,
-                             authz_read_func, authz_read_baton,
-                             pool));
+      SVN_ERR(detect_changed(&access_level, &changed_paths, newroot, fs,
+                             authz_read_func, authz_read_baton, pool));
 
       if (access_level == svn_repos_revision_access_none)
         {
@@ -1209,7 +1186,7 @@ fill_log_entry(svn_log_entry_t *log_entr
   return SVN_NO_ERROR;
 }
 
-/* Send a log message for REV to RECEIVER with its RECEIVER_BATON.
+/* Send a log message for REV to the CALLBACKS.
 
    FS is used with REV to fetch the interesting history information,
    such as changed paths, revprops, etc.
@@ -1237,7 +1214,6 @@ fill_log_entry(svn_log_entry_t *log_entr
 static svn_error_t *
 send_log(svn_revnum_t rev,
          svn_fs_t *fs,
-         apr_hash_t *prefetched_changes,
          svn_mergeinfo_t log_target_history_as_mergeinfo,
          svn_bit_array__t *nested_merges,
          svn_boolean_t discover_changed_paths,
@@ -1253,7 +1229,7 @@ send_log(svn_revnum_t rev,
   svn_boolean_t found_rev_of_interest = TRUE;
 
   log_entry = svn_log_entry_create(pool);
-  SVN_ERR(fill_log_entry(log_entry, rev, fs, prefetched_changes,
+  SVN_ERR(fill_log_entry(log_entry, rev, fs,
                          discover_changed_paths || handling_merged_revision,
                          revprops, callbacks->authz_read_func,
                          callbacks->authz_read_baton, pool));
@@ -2045,7 +2021,6 @@ do_logs(svn_fs_t *fs,
           svn_mergeinfo_t added_mergeinfo = NULL;
           svn_mergeinfo_t deleted_mergeinfo = NULL;
           svn_boolean_t has_children = FALSE;
-          apr_hash_t *changes = NULL;
 
           /* If we're including merged revisions, we need to calculate
              the mergeinfo deltas committed in this revision to our
@@ -2066,7 +2041,6 @@ do_logs(svn_fs_t *fs,
                 }
               SVN_ERR(get_combined_mergeinfo_changes(&added_mergeinfo,
                                                      &deleted_mergeinfo,
-                                                     &changes,
                                                      fs, cur_paths,
                                                      current,
                                                      iterpool, iterpool));
@@ -2079,7 +2053,7 @@ do_logs(svn_fs_t *fs,
              in anyway). */
           if (descending_order)
             {
-              SVN_ERR(send_log(current, fs, changes,
+              SVN_ERR(send_log(current, fs,
                                log_target_history_as_mergeinfo, nested_merges,
                                discover_changed_paths,
                                subtractive_merge, handling_merged_revisions,
@@ -2180,7 +2154,7 @@ do_logs(svn_fs_t *fs,
                               || apr_hash_count(deleted_mergeinfo) > 0);
             }
 
-          SVN_ERR(send_log(current, fs, NULL,
+          SVN_ERR(send_log(current, fs,
                            log_target_history_as_mergeinfo, nested_merges,
                            discover_changed_paths,
                            subtractive_merge, handling_merged_revisions,
@@ -2427,7 +2401,7 @@ svn_repos__get_logs5(svn_repos_t *repos,
             rev = end - i;
           else
             rev = start + i;
-          SVN_ERR(send_log(rev, fs, NULL, NULL, NULL,
+          SVN_ERR(send_log(rev, fs, NULL, NULL,
                            discover_changed_paths,
                            FALSE, FALSE, revprops, FALSE,
                            &callbacks, iterpool));



Mime
View raw message