Author: vmpn
Date: Thu Dec 27 03:21:18 2012
New Revision: 1426113

URL: http://svn.apache.org/viewvc?rev=1426113&view=rev
Log:
On the javahl-ra branch:

Bring up-to-date with trunk@1409227

Modified:
    subversion/branches/javahl-ra/   (props changed)
    subversion/branches/javahl-ra/subversion/libsvn_client/add.c
    subversion/branches/javahl-ra/subversion/tests/cmdline/depth_tests.py
    subversion/branches/javahl-ra/subversion/tests/cmdline/svntest/wc.py

Propchange: subversion/branches/javahl-ra/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1409166-1409227

Modified: subversion/branches/javahl-ra/subversion/libsvn_client/add.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_client/add.c?rev=1426113&r1=1426112&r2=1426113&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/libsvn_client/add.c (original)
+++ subversion/branches/javahl-ra/subversion/libsvn_client/add.c Thu Dec 27 
03:21:18 2012
@@ -348,14 +348,15 @@ add_file(const char *local_abspath,
             {
               /* Don't leave the job half-done. If we fail to set a property,
                * (try to) un-add the file. */
-              svn_error_clear(svn_wc_revert4(ctx->wc_ctx,
+              return svn_error_compose_create(
+                              err,
+                              svn_wc_revert4(ctx->wc_ctx,
                                              local_abspath,
                                              svn_depth_empty,
                                              FALSE /* use_commit_times */,
                                              NULL /* changelists */,
                                              NULL, NULL, NULL, NULL,
                                              pool));
-              return svn_error_trace(err);
             }
         }
     }
@@ -701,6 +702,7 @@ svn_client__get_all_auto_props(apr_hash_
   svn_boolean_t use_autoprops;
   collect_auto_props_baton_t autoprops_baton;
   svn_error_t *err = NULL;
+  apr_pool_t *iterpool = svn_pool_create(scratch_pool);
   svn_boolean_t target_is_url = svn_path_is_url(path_or_url);
   svn_config_t *cfg = ctx->config ? apr_hash_get(ctx->config,
                                                  SVN_CONFIG_CATEGORY_CONFIG,
@@ -708,6 +710,7 @@ svn_client__get_all_auto_props(apr_hash_
   *autoprops = apr_hash_make(result_pool);
   autoprops_baton.result_pool = result_pool;
   autoprops_baton.autoprops = *autoprops;
+  
 
   /* Are "traditional" auto-props enabled?  If so grab them from the
     config.  This is our starting set auto-props, which may be overriden
@@ -729,7 +732,7 @@ svn_client__get_all_auto_props(apr_hash_
 
   /* If PATH_OR_URL is a WC path, then it might be unversioned, in which case
      we find it's nearest versioned parent. */
-  while (err == NULL)
+  do
     {
       err = svn_client_propget5(&props, &inherited_config_auto_props,
                                 SVN_PROP_INHERITABLE_AUTO_PROPS, path_or_url,
@@ -750,6 +753,7 @@ svn_client__get_all_auto_props(apr_hash_
           break;
         }
     }
+  while (err == NULL);
 
   /* Stash any explicit PROPS for PARENT_PATH into the inherited props array,
      since these are actually inherited props for LOCAL_ABSPATH. */
@@ -774,7 +778,6 @@ svn_client__get_all_auto_props(apr_hash_
       apr_hash_index_t *hi;
       svn_prop_inherited_item_t *elt = APR_ARRAY_IDX(
         inherited_config_auto_props, i, svn_prop_inherited_item_t *);
-      apr_pool_t *iterpool = svn_pool_create(scratch_pool);
 
       for (hi = apr_hash_first(scratch_pool, elt->prop_hash);
            hi;
@@ -828,9 +831,11 @@ svn_client__get_all_auto_props(apr_hash_
               if (*ch == '\n')
                 ch++;
             }
-          svn_pool_destroy(iterpool);
         }
     }
+
+  svn_pool_destroy(iterpool);
+
   return SVN_NO_ERROR;
 }
 

Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/depth_tests.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/depth_tests.py?rev=1426113&r1=1426112&r2=1426113&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/depth_tests.py 
(original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/depth_tests.py Thu 
Dec 27 03:21:18 2012
@@ -106,7 +106,7 @@ def verify_depth(msg, depth, path="."):
                                                              [], "info", path)
     for line in out:
       if line.startswith("Depth:"):
-        raise svntest.failure(msg)
+        raise svntest.Failure(msg)
   else:
     expected_stdout = svntest.verify.ExpectedOutput("Depth: %s\n" % depth,
                                                     match_all=False)
@@ -2905,6 +2905,28 @@ def revert_depth_files(sbox):
   svntest.actions.run_and_verify_svn(None, expected_output, [],
                                      'revert', '--depth=files', 
sbox.ospath('A'))
 
+@Issue(4257)
+def spurious_nodes_row(sbox):
+  "update produces no spurious rows"
+
+  sbox.build(read_only = True)
+  return
+
+  val1 = svntest.wc.sqlite_stmt(sbox.wc_dir, "select count(*) from nodes")
+  expected_output = svntest.wc.State(sbox.wc_dir, { })
+  expected_disk = svntest.main.greek_state.copy()
+  expected_status = svntest.actions.get_virginal_state(sbox.wc_dir, 1)
+  svntest.actions.run_and_verify_update(sbox.wc_dir,
+                                        expected_output,
+                                        expected_disk,
+                                        expected_status,
+                                        None, None, None, None, None, False,
+                                        "--depth=empty", sbox.wc_dir)
+  val2 = svntest.wc.sqlite_stmt(sbox.wc_dir, "select count(*) from nodes")
+  if (val1 != val2):
+    # ra_neon added a spurious not-present row that does not show up in status
+    raise svntest.Failure("count changed from '%s' to '%s'" % (val1, val2))
+
 
 #----------------------------------------------------------------------
 # list all tests here, starting with None:
@@ -2955,6 +2977,7 @@ test_list = [ None,
               update_below_depth_empty,
               commit_then_immediates_update,
               revert_depth_files,
+              spurious_nodes_row,
               ]
 
 if __name__ == "__main__":

Modified: subversion/branches/javahl-ra/subversion/tests/cmdline/svntest/wc.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/tests/cmdline/svntest/wc.py?rev=1426113&r1=1426112&r2=1426113&view=diff
==============================================================================
--- subversion/branches/javahl-ra/subversion/tests/cmdline/svntest/wc.py 
(original)
+++ subversion/branches/javahl-ra/subversion/tests/cmdline/svntest/wc.py Thu 
Dec 27 03:21:18 2012
@@ -886,6 +886,14 @@ def text_base_path(file_path):
 
   raise svntest.Failure("No pristine text for " + relpath)
 
+def sqlite_stmt(wc_root_path, stmt):
+  """Execute STMT on the SQLite wc.db in WC_ROOT_PATH and return the
+     results."""
+
+  db = open_wc_db(wc_root_path)[0]
+  c = db.cursor()
+  c.execute(stmt)
+  return c.fetchall()
 
 # ------------
 ### probably toss these at some point. or major rework. or something.


Reply via email to