You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by rh...@apache.org on 2011/03/24 12:13:01 UTC

svn commit: r1084897 - in /subversion/trunk/subversion/libsvn_wc: translate.c workqueue.c

Author: rhuijben
Date: Thu Mar 24 11:13:01 2011
New Revision: 1084897

URL: http://svn.apache.org/viewvc?rev=1084897&view=rev
Log:
Optimize file access bit handling a tiny bit. (Improves checkout speed on
Windows by 2-5%; probably more on network paths)

* subversion/libsvn_wc/translate.c
  (svn_wc__maybe_set_executable): Don't retrieve executable property on
    Windows as we can't change it anyway.

* subversion/libsvn_wc/workqueue.c
  (sync_file_flags): Only reset bits if we didn't set them.

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=1084897&r1=1084896&r2=1084897&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/translate.c (original)
+++ subversion/trunk/subversion/libsvn_wc/translate.c Thu Mar 24 11:13:01 2011
@@ -348,6 +348,7 @@ svn_wc__maybe_set_executable(svn_boolean
                              const char *local_abspath,
                              apr_pool_t *scratch_pool)
 {
+#ifndef WIN32
   const svn_string_t *propval;
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
@@ -362,8 +363,10 @@ svn_wc__maybe_set_executable(svn_boolean
       if (did_set)
         *did_set = TRUE;
     }
-  else if (did_set)
-    *did_set = FALSE;
+  else
+#endif
+    if (did_set)
+      *did_set = FALSE;
 
   return SVN_NO_ERROR;
 }
@@ -377,6 +380,7 @@ svn_wc__maybe_set_read_only(svn_boolean_
 {
   const svn_string_t *needs_lock;
   svn_wc__db_status_t status;
+  svn_wc__db_kind_t kind;
   svn_wc__db_lock_t *lock;
   svn_error_t *err;
 
@@ -385,7 +389,7 @@ svn_wc__maybe_set_read_only(svn_boolean_
 
   SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
 
-  err = svn_wc__db_read_info(&status, NULL, NULL, NULL, NULL, NULL,
+  err = svn_wc__db_read_info(&status, &kind, NULL, NULL, NULL, NULL,
                              NULL, NULL, NULL, NULL, NULL,
                              NULL, NULL, NULL, NULL, NULL, NULL,
                              NULL, NULL, NULL, NULL, NULL, NULL,
@@ -396,15 +400,17 @@ svn_wc__maybe_set_read_only(svn_boolean_
     {
       /* If the path wasn't versioned, we still want to set it to read-only. */
       svn_error_clear(err);
+      status = svn_wc__db_status_not_present;
     }
   else if (err)
     return svn_error_return(err);
   else if (lock)
-    /* ### Is this "we have the lock?" */
+    return SVN_NO_ERROR; /* We have a lock */
+  else if (kind != svn_wc__db_kind_file)
     return SVN_NO_ERROR;
 
   /* Files that aren't in the repository yet should be left writable. */
-  if (status == svn_wc__db_status_added)
+  if (status != svn_wc__db_status_normal)
     return SVN_NO_ERROR;
 
   SVN_ERR(svn_wc__internal_propget(&needs_lock, db, local_abspath,

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=1084897&r1=1084896&r2=1084897&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Thu Mar 24 11:13:01 2011
@@ -93,14 +93,19 @@ sync_file_flags(svn_wc__db_t *db,
                 const char *local_abspath,
                 apr_pool_t *scratch_pool)
 {
-  /* ### right now, the maybe_set_* functions will only positively set those
-     ### values. we need to clear them first.  */
-  SVN_ERR(svn_io_set_file_read_write(local_abspath, FALSE, scratch_pool));
-  SVN_ERR(svn_io_set_file_executable(local_abspath, FALSE, FALSE,
-                                     scratch_pool));
+  svn_boolean_t did_set;
+
+  SVN_ERR(svn_wc__maybe_set_read_only(&did_set, db, local_abspath,
+                                      scratch_pool));
+  if (!did_set)
+    SVN_ERR(svn_io_set_file_read_write(local_abspath, FALSE, scratch_pool));
 
-  SVN_ERR(svn_wc__maybe_set_read_only(NULL, db, local_abspath, scratch_pool));
-  SVN_ERR(svn_wc__maybe_set_executable(NULL, db, local_abspath, scratch_pool));
+  SVN_ERR(svn_wc__maybe_set_executable(&did_set, db, local_abspath,
+                                       scratch_pool));
+
+  if (!did_set)
+    SVN_ERR(svn_io_set_file_executable(local_abspath, FALSE, FALSE,
+                                       scratch_pool));
 
   return SVN_NO_ERROR;
 }