You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2011/04/26 17:12:52 UTC

svn commit: r1096776 - /subversion/trunk/subversion/libsvn_wc/translate.c

Author: hwright
Date: Tue Apr 26 15:12:52 2011
New Revision: 1096776

URL: http://svn.apache.org/viewvc?rev=1096776&view=rev
Log:
Add a special case to the sync_flags_with_props code:
When we add a svn:needs-lock property to a node, we don't actually
change the read-only flag until commit.

* subversion/libsvn_wc/translate.c
  (svn_wc__sync_flags_with_props): Possibly get the pristine props to implement
    the above.

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

Modified: subversion/trunk/subversion/libsvn_wc/translate.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/translate.c?rev=1096776&r1=1096775&r2=1096776&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/translate.c (original)
+++ subversion/trunk/subversion/libsvn_wc/translate.c Tue Apr 26 15:12:52 2011
@@ -381,13 +381,25 @@ svn_wc__sync_flags_with_props(svn_boolea
   /* Handle the read-write bit. */
   if (status != svn_wc__db_status_normal
       || props == NULL
-      || ! apr_hash_get(props, SVN_PROP_NEEDS_LOCK, APR_HASH_KEY_STRING))
+      || ! apr_hash_get(props, SVN_PROP_NEEDS_LOCK, APR_HASH_KEY_STRING)
+      || lock)
     {
       SVN_ERR(svn_io_set_file_read_write(local_abspath, FALSE, scratch_pool));
     }
   else
     {
-      if (! lock)
+      /* Special case: If we have an uncommitted svn:needs-lock, we don't
+         set the file read_only just yet.  That happens upon commit. */
+      apr_hash_t *pristine_props;
+
+      SVN_ERR(svn_wc__get_pristine_props(&pristine_props, db, local_abspath,
+                                         scratch_pool, scratch_pool));
+
+      if (pristine_props
+            && apr_hash_get(pristine_props,
+                            SVN_PROP_NEEDS_LOCK, APR_HASH_KEY_STRING) )
+            /*&& props
+            && apr_hash_get(props, SVN_PROP_NEEDS_LOCK, APR_HASH_KEY_STRING) )*/
         SVN_ERR(svn_io_set_file_read_only(local_abspath, FALSE, scratch_pool));
     }