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 2012/06/05 15:53:51 UTC

svn commit: r1346388 - /subversion/trunk/subversion/libsvn_wc/workqueue.c

Author: rhuijben
Date: Tue Jun  5 13:53:51 2012
New Revision: 1346388

URL: http://svn.apache.org/viewvc?rev=1346388&view=rev
Log:
* subversion/libsvn_wc/workqueue.c
  (run_file_install): Avoid 2 db calls on checkout for files with
    svn:executable and/or svn:needs-lock by using the available
    property values directly.

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

Modified: subversion/trunk/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/workqueue.c?rev=1346388&r1=1346387&r2=1346388&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/trunk/subversion/libsvn_wc/workqueue.c Tue Jun  5 13:53:51 2012
@@ -715,6 +715,8 @@ run_file_install(svn_wc__db_t *db,
                                scratch_pool));
 
       /* No need to set exec or read-only flags on special files.  */
+
+      /* ### Shouldn't this record a timestamp and size, etc.? */
       return SVN_NO_ERROR;
     }
 
@@ -781,12 +783,26 @@ run_file_install(svn_wc__db_t *db,
   }
 
   /* Tweak the on-disk file according to its properties.  */
-  if (props
-      && (apr_hash_get(props, SVN_PROP_NEEDS_LOCK, APR_HASH_KEY_STRING)
-          || apr_hash_get(props, SVN_PROP_EXECUTABLE, APR_HASH_KEY_STRING)))
-    {
-      SVN_ERR(svn_wc__sync_flags_with_props(NULL, db, local_abspath,
-                                            scratch_pool));
+#ifndef WIN32
+  if (props && apr_hash_get(props, SVN_PROP_EXECUTABLE, APR_HASH_KEY_STRING))
+    SVN_ERR(svn_io_set_file_executable(local_abspath, TRUE, FALSE,
+                                       scratch_pool));
+#endif
+
+  /* Note that this explicitly checks the pristine properties, to make sure
+     that when the lock is locally set (=modification) it is not read only */
+  if (props && apr_hash_get(props, SVN_PROP_NEEDS_LOCK, APR_HASH_KEY_STRING))
+    {
+      svn_wc__db_lock_t *lock;
+      SVN_ERR(svn_wc__db_read_info(NULL, NULL, 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,
+                                   db, local_abspath,
+                                   scratch_pool, scratch_pool));
+
+      if (lock)
+        SVN_ERR(svn_io_set_file_read_only(local_abspath, FALSE, scratch_pool));
     }
 
   if (use_commit_times)