subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhuij...@apache.org
Subject svn commit: r1427807 - in /subversion/trunk/subversion/libsvn_wc: translate.c workqueue.c
Date Wed, 02 Jan 2013 14:55:32 GMT
Author: rhuijben
Date: Wed Jan  2 14:55:31 2013
New Revision: 1427807

URL: http://svn.apache.org/viewvc?rev=1427807&view=rev
Log:
* subversion/libsvn_wc/translate.c
  (svn_wc__sync_flags_with_props): Try to avoid unnecessary db transactions by
    using more information from the initial _read_info() call.

Modified:
    subversion/trunk/subversion/libsvn_wc/translate.c
    subversion/trunk/subversion/libsvn_wc/workqueue.c

Modified: subversion/trunk/subversion/libsvn_wc/translate.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/translate.c?rev=1427807&r1=1427806&r2=1427807&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/translate.c (original)
+++ subversion/trunk/subversion/libsvn_wc/translate.c Wed Jan  2 14:55:31 2013
@@ -368,6 +368,8 @@ svn_wc__sync_flags_with_props(svn_boolea
   svn_kind_t kind;
   svn_wc__db_lock_t *lock;
   apr_hash_t *props = NULL;
+  svn_boolean_t had_props;
+  svn_boolean_t props_mod;
 
   if (did_set)
     *did_set = FALSE;
@@ -378,18 +380,25 @@ svn_wc__sync_flags_with_props(svn_boolea
   SVN_ERR(svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL, NULL,
                                NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
                                NULL, &lock, NULL, NULL, NULL, NULL, NULL,
-                               NULL, NULL, NULL, NULL, NULL,
+                               &had_props, &props_mod, NULL, NULL, NULL,
                                db, local_abspath,
                                scratch_pool, scratch_pool));
 
-  SVN_ERR(svn_wc__db_read_props(&props, db, local_abspath, scratch_pool,
-                                scratch_pool));
-
   /* We actually only care about the following flags on files, so just
-     early-out for all other types. */
-  if (kind != svn_kind_file)
+     early-out for all other types.
+
+     Also bail if there is no in-wc representation of the file. */
+  if (kind != svn_kind_file
+      || (status != svn_wc__db_status_normal
+          && status != svn_wc__db_status_added))
     return SVN_NO_ERROR;
 
+  if (props_mod || had_props)
+    SVN_ERR(svn_wc__db_read_props(&props, db, local_abspath, scratch_pool,
+                                  scratch_pool));
+  else
+    props = NULL;
+
   /* If we get this far, we're going to change *something*, so just set
      the flag appropriately. */
   if (did_set)
@@ -409,8 +418,13 @@ svn_wc__sync_flags_with_props(svn_boolea
          set the file read_only just yet.  That happens upon commit. */
       apr_hash_t *pristine_props;
 
-      SVN_ERR(svn_wc__db_read_pristine_props(&pristine_props, db, local_abspath,
-                                             scratch_pool, scratch_pool));
+      if (! props_mod)
+        pristine_props = props;
+      else if (had_props)
+        SVN_ERR(svn_wc__db_read_pristine_props(&pristine_props, db, local_abspath,
+                                                scratch_pool, scratch_pool));
+      else
+        pristine_props = NULL;
 
       if (pristine_props
             && apr_hash_get(pristine_props,
@@ -423,9 +437,7 @@ svn_wc__sync_flags_with_props(svn_boolea
 /* Windows doesn't care about the execute bit. */
 #ifndef WIN32
 
-  if ( ( status != svn_wc__db_status_normal
-        && status != svn_wc__db_status_added )
-      || props == NULL
+  if (props == NULL
       || ! apr_hash_get(props, SVN_PROP_EXECUTABLE, APR_HASH_KEY_STRING))
     {
       /* Turn off the execute bit */

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=1427807&r1=1427806&r2=1427807&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Wed Jan  2 14:55:31 2013
@@ -383,10 +383,6 @@ svn_wc__wq_build_file_commit(svn_skel_t 
   SVN_ERR(svn_wc__db_to_relpath(&local_relpath, db, local_abspath,
                                 local_abspath, result_pool, scratch_pool));
 
-  /* This are currently ignored, they are here for compat. */
-  svn_skel__prepend_int(FALSE, *work_item, result_pool);
-  svn_skel__prepend_int(FALSE, *work_item, result_pool);
-
   svn_skel__prepend_str(local_relpath, *work_item, result_pool);
 
   svn_skel__prepend_str(OP_FILE_COMMIT, *work_item, result_pool);



Mime
View raw message