subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pbu...@apache.org
Subject svn commit: r1091882 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_client/merge.c libsvn_client/patch.c libsvn_client/status.c libsvn_wc/status.c
Date Wed, 13 Apr 2011 18:45:37 GMT
Author: pburba
Date: Wed Apr 13 18:45:37 2011
New Revision: 1091882

URL: http://svn.apache.org/viewvc?rev=1091882&view=rev
Log:
Teach svn_wc_walk_status() to optionally skip check for text modifications.

Adjust the walk for subtrees of merge-tracking importance to use this new
option.  This avoids the needless performance penalty that checking for text
modifications incurs.

* subversion/include/svn_wc.h

  (svn_wc_walk_status): Add argument to optionally disable checking for text
   modifications.

* subversion/libsvn_client/merge.c

  (get_mergeinfo_paths): Update call to svn_wc_walk_status(), don't bother
   checking for text mods, we don't need to know about them here. 

* subversion/libsvn_client/patch.c
  (check_dir_empty):
* subversion/libsvn_client/status.c
  (svn_client_status5):
   Update calls to svn_wc_walk_status(), maintaining existing behavior.

* subversion/libsvn_wc/status.c

  (assemble_status): Add argument to optionally disable checking for text
   modifications.

  (send_status_structure,
   get_dir_status,
   handle_dir_entry,
   svn_wc_walk_status): Add argument to optionally disable checking for text
   modifications and pass that along.

  (make_dir_baton,
   handle_statii,
   close_directory,
   close_edit,
   internal_status): Update calls to get_dir_status(), svn_wc_walk_status()
   and assemble_status(), maintaining existing behavior of checking for
   text modifications.

Modified:
    subversion/trunk/subversion/include/svn_wc.h
    subversion/trunk/subversion/libsvn_client/merge.c
    subversion/trunk/subversion/libsvn_client/patch.c
    subversion/trunk/subversion/libsvn_client/status.c
    subversion/trunk/subversion/libsvn_wc/status.c

Modified: subversion/trunk/subversion/include/svn_wc.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=1091882&r1=1091881&r2=1091882&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Wed Apr 13 18:45:37 2011
@@ -3813,6 +3813,12 @@ typedef void (*svn_wc_status_func_t)(voi
  *   - If @a get_all is FALSE, then only locally-modified entries will be
  *     returned.  If TRUE, then all entries will be returned.
  *
+ *   - If @a ignore_text_mods is TRUE, then the walk will not check for
+ *     modified files.  Any #svn_wc_status3_t structures returned for files
+ *     will always have a text_status field set to svn_wc_status_normal.
+ *     If @a ignore_text_mods is FALSE, the walk checks for text changes
+ *     and returns #svn_wc_status3_t structures describing any changes.
+ *
  *   - If @a depth is #svn_depth_empty, a status structure will
  *     be returned for the target only; if #svn_depth_files, for the
  *     target and its immediate file children; if
@@ -3852,6 +3858,7 @@ svn_wc_walk_status(svn_wc_context_t *wc_
                    svn_depth_t depth,
                    svn_boolean_t get_all,
                    svn_boolean_t no_ignore,
+                   svn_boolean_t ignore_text_mods,
                    const apr_array_header_t *ignore_patterns,
                    svn_wc_status_func4_t status_func,
                    void *status_baton,

Modified: subversion/trunk/subversion/libsvn_client/merge.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/merge.c?rev=1091882&r1=1091881&r2=1091882&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/merge.c (original)
+++ subversion/trunk/subversion/libsvn_client/merge.c Wed Apr 13 18:45:37 2011
@@ -5820,7 +5820,7 @@ get_mergeinfo_paths(apr_array_header_t *
   pre_merge_status_baton.pool = scratch_pool;
   SVN_ERR(svn_wc_walk_status(merge_cmd_baton->ctx->wc_ctx,
                              merge_cmd_baton->target_abspath,
-                             depth, TRUE, TRUE, NULL,
+                             depth, TRUE, TRUE, TRUE, NULL,
                              pre_merge_status_cb,
                              &pre_merge_status_baton,
                              NULL, NULL,

Modified: subversion/trunk/subversion/libsvn_client/patch.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/patch.c?rev=1091882&r1=1091881&r2=1091882&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/patch.c (original)
+++ subversion/trunk/subversion/libsvn_client/patch.c Wed Apr 13 18:45:37 2011
@@ -2400,7 +2400,7 @@ check_dir_empty(svn_boolean_t *empty, co
   btn.parent_path = local_abspath;
   btn.result_pool = scratch_pool;
   SVN_ERR(svn_wc_walk_status(wc_ctx, local_abspath, svn_depth_immediates,
-                             TRUE, TRUE, NULL, find_existing_children,
+                             TRUE, TRUE, FALSE, NULL, find_existing_children,
                              &btn, NULL, NULL, NULL, NULL, scratch_pool));
   *empty = TRUE;
 

Modified: subversion/trunk/subversion/libsvn_client/status.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/status.c?rev=1091882&r1=1091881&r2=1091882&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/status.c (original)
+++ subversion/trunk/subversion/libsvn_client/status.c Wed Apr 13 18:45:37 2011
@@ -515,7 +515,7 @@ svn_client_status5(svn_revnum_t *result_
   else
     {
       err = svn_wc_walk_status(ctx->wc_ctx, target_abspath,
-                               depth, get_all, no_ignore, ignores,
+                               depth, get_all, no_ignore, FALSE, ignores,
                                tweak_status, &sb,
                                ignore_externals
                                    ? NULL

Modified: subversion/trunk/subversion/libsvn_wc/status.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/status.c?rev=1091882&r1=1091881&r2=1091882&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/status.c Wed Apr 13 18:45:37 2011
@@ -362,7 +362,9 @@ internal_status(svn_wc_status3_t **statu
 
    If GET_ALL is FALSE, and LOCAL_ABSPATH is not locally modified, then
    *STATUS will be set to NULL.  If GET_ALL is non-zero, then *STATUS will be
-   allocated and returned no matter what.
+   allocated and returned no matter what.  If IGNORE_TEXT_MODS is TRUE then
+   don't check for text mods, assume there are none and set and *STATUS
+   returned to reflect that assumption.
 
    The status struct's repos_lock field will be set to REPOS_LOCK.
 */
@@ -375,6 +377,7 @@ assemble_status(svn_wc_status3_t **statu
                 const struct svn_wc__db_info_t *info,
                 const svn_io_dirent2_t *dirent,
                 svn_boolean_t get_all,
+                svn_boolean_t ignore_text_mods,
                 const svn_lock_t *repos_lock,
                 apr_pool_t *result_pool,
                 apr_pool_t *scratch_pool)
@@ -512,11 +515,12 @@ assemble_status(svn_wc_status3_t **statu
              to avoid an extra filestat for every file, which can be
              expensive on network drives as a filestat usually can't
              be cached there */
-          if (dirent
-              && dirent->filesize != SVN_INVALID_FILESIZE
-              && dirent->mtime != 0
-              && info->translated_size == dirent->filesize
-              && info->last_mod_time == dirent->mtime)
+          if (ignore_text_mods
+              ||(dirent
+                 && dirent->filesize != SVN_INVALID_FILESIZE
+                 && dirent->mtime != 0
+                 && info->translated_size == dirent->filesize
+                 && info->last_mod_time == dirent->mtime))
             text_modified_p = FALSE;
           else
             {
@@ -769,6 +773,7 @@ send_status_structure(const struct walk_
                       const struct svn_wc__db_info_t *info,
                       const svn_io_dirent2_t *dirent,
                       svn_boolean_t get_all,
+                      svn_boolean_t ignore_text_mods,
                       svn_wc_status_func4_t status_func,
                       void *status_baton,
                       apr_pool_t *scratch_pool)
@@ -799,7 +804,7 @@ send_status_structure(const struct walk_
 
   SVN_ERR(assemble_status(&statstruct, wb->db, local_abspath,
                           parent_repos_root_url, parent_repos_relpath,
-                          info, dirent, get_all,
+                          info, dirent, get_all, ignore_text_mods,
                           repos_lock, scratch_pool, scratch_pool));
 
   if (statstruct && status_func)
@@ -967,6 +972,7 @@ get_dir_status(const struct walk_status_
                svn_depth_t depth,
                svn_boolean_t get_all,
                svn_boolean_t no_ignore,
+               svn_boolean_t ignore_text_mods,
                svn_wc_status_func4_t status_func,
                void *status_baton,
                svn_cancel_func_t cancel_func,
@@ -989,6 +995,7 @@ handle_dir_entry(const struct walk_statu
                  svn_depth_t depth,
                  svn_boolean_t get_all,
                  svn_boolean_t no_ignore,
+                 svn_boolean_t ignore_text_mods,
                  svn_wc_status_func4_t status_func,
                  void *status_baton,
                  svn_cancel_func_t cancel_func,
@@ -1018,6 +1025,7 @@ handle_dir_entry(const struct walk_statu
                                  dir_repos_root_url, dir_repos_relpath,
                                  entry_info,
                                  dirent, ignores, depth, get_all, no_ignore,
+                                 ignore_text_mods,
                                  status_func, status_baton, cancel_func,
                                  cancel_baton,
                                  pool));
@@ -1030,6 +1038,7 @@ handle_dir_entry(const struct walk_statu
                                         dir_repos_root_url,
                                         dir_repos_relpath,
                                         entry_info, dirent, get_all,
+                                        ignore_text_mods,
                                         status_func, status_baton, pool));
         }
     }
@@ -1040,6 +1049,7 @@ handle_dir_entry(const struct walk_statu
                                     dir_repos_root_url,
                                     dir_repos_relpath,
                                     entry_info, dirent, get_all,
+                                    ignore_text_mods,
                                     status_func, status_baton, pool));
     }
 
@@ -1127,6 +1137,7 @@ get_dir_status(const struct walk_status_
                svn_depth_t depth,
                svn_boolean_t get_all,
                svn_boolean_t no_ignore,
+               svn_boolean_t ignore_text_mods,
                svn_wc_status_func4_t status_func,
                void *status_baton,
                svn_cancel_func_t cancel_func,
@@ -1203,6 +1214,7 @@ get_dir_status(const struct walk_status_
                                       parent_repos_root_url,
                                       parent_repos_relpath,
                                       dir_info, dirent, get_all,
+                                      ignore_text_mods,
                                       status_func, status_baton,
                                       iterpool));
 
@@ -1255,6 +1267,7 @@ get_dir_status(const struct walk_status_
                                                            : svn_depth_empty,
                                        get_all,
                                        no_ignore,
+                                       ignore_text_mods,
                                        status_func, status_baton,
                                        cancel_func, cancel_baton, iterpool));
               continue;
@@ -1595,7 +1608,7 @@ make_dir_baton(void **dir_baton,
                              d->depth == svn_depth_files
                                       ? svn_depth_files
                                       : svn_depth_immediates,
-                             TRUE, TRUE,
+                             TRUE, TRUE, FALSE,
                              hash_stash, d->statii,
                              eb->cancel_func, eb->cancel_baton,
                              pool));
@@ -1772,6 +1785,7 @@ handle_statii(struct edit_baton *eb,
                                  NULL,
                                  NULL /* dirent */,
                                  ignores, depth, eb->get_all, eb->no_ignore,
+                                 FALSE,
                                  status_func, status_baton,
                                  eb->cancel_func, eb->cancel_baton,
                                  iterpool));
@@ -2042,6 +2056,7 @@ close_directory(void *dir_baton,
                                          eb->ignores,
                                          eb->default_depth,
                                          eb->get_all, eb->no_ignore,
+                                         FALSE,
                                          eb->status_func, eb->status_baton,
                                          eb->cancel_func, eb->cancel_baton,
                                          pool));
@@ -2239,6 +2254,7 @@ close_edit(void *edit_baton,
                              eb->default_depth,
                              eb->get_all,
                              eb->no_ignore,
+                             FALSE,
                              eb->ignores,
                              eb->status_func,
                              eb->status_baton,
@@ -2359,6 +2375,7 @@ svn_wc_walk_status(svn_wc_context_t *wc_
                    svn_depth_t depth,
                    svn_boolean_t get_all,
                    svn_boolean_t no_ignore,
+                   svn_boolean_t ignore_text_mods,
                    const apr_array_header_t *ignore_patterns,
                    svn_wc_status_func4_t status_func,
                    void *status_baton,
@@ -2425,6 +2442,7 @@ svn_wc_walk_status(svn_wc_context_t *wc_
                          depth,
                          get_all,
                          no_ignore,
+                         ignore_text_mods,
                          status_func, status_baton,
                          cancel_func, cancel_baton,
                          scratch_pool));
@@ -2566,6 +2584,7 @@ internal_status(svn_wc_status3_t **statu
                                           NULL,
                                           dirent,
                                           TRUE /* get_all */,
+                                          FALSE,
                                           NULL /* repos_lock */,
                                           result_pool, scratch_pool));
 }



Mime
View raw message