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/11/26 20:45:00 UTC

svn commit: r1413801 - in /subversion/trunk/subversion: libsvn_wc/wc-queries.sql libsvn_wc/wc_db.c tests/cmdline/iprop_tests.py

Author: rhuijben
Date: Mon Nov 26 19:44:59 2012
New Revision: 1413801

URL: http://svn.apache.org/viewvc?rev=1413801&view=rev
Log:
Keep the inherited property cache when committing and add a regression test to
make sure that this keeps working.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_NODE_INFO,
   STMT_SELECT_NODE_INFO_WITH_LOCK): Add inherited property column to results.
  (STMT_APPLY_CHANGES_TO_BASE_NODE): Allow setting inherited properties.

* subversion/libsvn_wc/wc_db.c
  (read_info): Update offsets.
  (commit_node): Cache and restore inherited properties.

* subversion/tests/cmdline/iprop_tests.py
  (iprops_survive_commit): New test.
  (test_list): Add iprops_survive_commit.

Modified:
    subversion/trunk/subversion/libsvn_wc/wc-queries.sql
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/tests/cmdline/iprop_tests.py

Modified: subversion/trunk/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc-queries.sql?rev=1413801&r1=1413800&r2=1413801&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Mon Nov 26 19:44:59 2012
@@ -29,7 +29,7 @@
 -- STMT_SELECT_NODE_INFO
 SELECT op_depth, repos_id, repos_path, presence, kind, revision, checksum,
   translated_size, changed_revision, changed_date, changed_author, depth,
-  symlink_target, last_mod_time, properties, moved_here
+  symlink_target, last_mod_time, properties, moved_here, inherited_props
 FROM nodes
 WHERE wc_id = ?1 AND local_relpath = ?2
 ORDER BY op_depth DESC
@@ -38,6 +38,7 @@ ORDER BY op_depth DESC
 SELECT op_depth, nodes.repos_id, nodes.repos_path, presence, kind, revision,
   checksum, translated_size, changed_revision, changed_date, changed_author,
   depth, symlink_target, last_mod_time, properties, moved_here,
+  inherited_props,
   /* All the columns until now must match those returned by
      STMT_SELECT_NODE_INFO. The implementation of svn_wc__db_read_info()
      assumes that these columns are followed by the lock information) */
@@ -798,9 +799,9 @@ INSERT OR REPLACE INTO nodes (
   wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path,
   revision, presence, depth, kind, changed_revision, changed_date,
   changed_author, checksum, properties, dav_cache, symlink_target,
-  file_external )
+  inherited_props, file_external )
 VALUES (?1, ?2, 0,
-        ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16,
+        ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17,
         (SELECT file_external FROM nodes
           WHERE wc_id = ?1
             AND local_relpath = ?2

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1413801&r1=1413800&r2=1413801&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Mon Nov 26 19:44:59 2012
@@ -7667,7 +7667,7 @@ read_info(svn_wc__db_status_t *status,
           if (op_depth != 0)
             *lock = NULL;
           else
-            *lock = lock_from_columns(stmt_info, 16, 17, 18, 19, result_pool);
+            *lock = lock_from_columns(stmt_info, 17, 18, 19, 20, result_pool);
         }
 
       if (have_work)
@@ -9712,6 +9712,7 @@ commit_node(void *baton,
   svn_sqlite__stmt_t *stmt_act;
   svn_boolean_t have_act;
   svn_string_t prop_blob = { 0 };
+  svn_string_t inherited_prop_blob = { 0 };
   const char *changelist = NULL;
   const char *parent_relpath;
   svn_wc__db_status_t new_presence;
@@ -9781,6 +9782,10 @@ commit_node(void *baton,
     prop_blob.data = svn_sqlite__column_blob(stmt_info, 14, &prop_blob.len,
                                              scratch_pool);
 
+  inherited_prop_blob.data = svn_sqlite__column_blob(stmt_info, 16,
+                                                     &inherited_prop_blob.len,
+                                                     scratch_pool);
+
   if (cb->keep_changelist && have_act)
     changelist = svn_sqlite__column_text(stmt_act, 0, scratch_pool);
 
@@ -9867,6 +9872,11 @@ commit_node(void *baton,
                                     scratch_pool));
   SVN_ERR(svn_sqlite__bind_properties(stmt, 15, cb->new_dav_cache,
                                       scratch_pool));
+  if (inherited_prop_blob.data != NULL)
+    {
+      SVN_ERR(svn_sqlite__bind_blob(stmt, 17, inherited_prop_blob.data,
+                                    inherited_prop_blob.len));
+    }
 
   SVN_ERR(svn_sqlite__step_done(stmt));
 

Modified: subversion/trunk/subversion/tests/cmdline/iprop_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/iprop_tests.py?rev=1413801&r1=1413800&r2=1413801&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/iprop_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/iprop_tests.py Mon Nov 26 19:44:59 2012
@@ -1635,6 +1635,40 @@ def iprops_with_file_externals(sbox):
     sbox.ospath('A/B/E/file-external'), expected_iprops,
     expected_explicit_props)
 
+def iprops_survive_commit(sbox):
+  "verify that iprops survive a commit"
+
+  sbox.build()
+  sbox.simple_propset('key', 'D', 'A/B',)
+  sbox.simple_commit()
+
+  svntest.main.run_svn(None, 'switch', sbox.repo_url + '/A/B/E',
+                       sbox.ospath('A/D'), '--ignore-ancestry')
+  svntest.main.run_svn(None, 'switch', sbox.repo_url + '/A/B/F',
+                       sbox.ospath('iota'), '--ignore-ancestry')
+  expected_iprops = {
+    sbox.repo_url + '/A/B' : {'key'   : 'D'},
+  }
+
+  expected_explicit_props = {}
+  svntest.actions.run_and_verify_inherited_prop_xml(sbox.ospath('A/D'),
+                                                    expected_iprops,
+                                                    expected_explicit_props)
+  svntest.actions.run_and_verify_inherited_prop_xml(sbox.ospath('iota'),
+                                                    expected_iprops,
+                                                    expected_explicit_props)
+
+  sbox.simple_propset('new', 'V', 'A/D', 'iota')
+  sbox.simple_commit()
+
+  expected_explicit_props = {'new': 'V'}
+  svntest.actions.run_and_verify_inherited_prop_xml(sbox.ospath('A/D'),
+                                                    expected_iprops,
+                                                    expected_explicit_props)
+  svntest.actions.run_and_verify_inherited_prop_xml(sbox.ospath('iota'),
+                                                    expected_iprops,
+                                                    expected_explicit_props)
+
 ########################################################################
 # Run the tests
 
@@ -1648,6 +1682,7 @@ test_list = [ None,
               iprops_shallow_operative_depths,
               iprops_with_directory_externals,
               iprops_with_file_externals,
+              iprops_survive_commit,
             ]
 
 if __name__ == '__main__':