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

svn commit: r1076741 - in /subversion/trunk/subversion/libsvn_wc: revision_status.c wc_db.c wc_db.h

Author: stsp
Date: Thu Mar  3 19:23:12 2011
New Revision: 1076741

URL: http://svn.apache.org/viewvc?rev=1076741&view=rev
Log:
Another step towards eliminating use of the node walker in
svn_wc_revision_status2(): use a DB query to determine if any absent
nodes are present in the working copy.

* subversion/libsvn_wc/revision_status.c
  (analyze_status): Ignore absent node ninformation during the crawl.
  (svn_wc_revision_status2): Get revision number information from wc.db
   using the new svn_wc__db_has_absent_children() function.

* subversion/libsvn_wc/wc-queries.sql
  (STMT_SELECT_MIN_MAX_REVISIONS): New query which returns revision
   information previously obtained during the crawl in analyze_status().

* subversion/libsvn_wc/wc_db.c
  (svn_wc__db_has_absent_children): New. Uses an existing query called
   STMT_SELECT_ABSENT_NODES.

* subversion/libsvn_wc/wc_db.h
  (svn_wc__db_has_absent_children): Declare.

Modified:
    subversion/trunk/subversion/libsvn_wc/revision_status.c
    subversion/trunk/subversion/libsvn_wc/wc_db.c
    subversion/trunk/subversion/libsvn_wc/wc_db.h

Modified: subversion/trunk/subversion/libsvn_wc/revision_status.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/revision_status.c?rev=1076741&r1=1076740&r2=1076741&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/revision_status.c (original)
+++ subversion/trunk/subversion/libsvn_wc/revision_status.c Thu Mar  3 19:23:12 2011
@@ -70,11 +70,10 @@ analyze_status(const char *local_abspath
                                NULL, NULL, NULL, NULL, wb->db,
                                local_abspath, scratch_pool, scratch_pool));
 
-  /* We need the excluded and absent paths when checking for sparse
-   * checkouts. But only for that. To collect those we're walking all the
-   * hidden nodes. */
-  if (status == svn_wc__db_status_excluded
-      || status == svn_wc__db_status_absent)
+  /* We need the excluded paths when checking for sparse checkouts (absent
+   * paths are already taken care of within svn_wc_revision_status2).
+   * But only for that. To collect those we're walking all the hidden nodes. */
+  if (status == svn_wc__db_status_excluded)
     {
       wb->result->sparse_checkout = TRUE;
       return SVN_NO_ERROR;
@@ -185,6 +184,10 @@ svn_wc_revision_status2(svn_wc_revision_
   SVN_ERR(svn_wc__db_get_min_max_revisions(&result->min_rev, &result->max_rev,
                                            wc_ctx->db, local_abspath,
                                            scratch_pool));
+
+  SVN_ERR(svn_wc__db_has_absent_children(&result->sparse_checkout, wc_ctx->db,
+                                         local_abspath, scratch_pool));
+
   SVN_ERR(svn_wc__node_walk_children(wc_ctx,
                                      local_abspath,
                                      TRUE /* show_hidden */,

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1076741&r1=1076740&r2=1076741&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Mar  3 19:23:12 2011
@@ -9203,3 +9203,37 @@ svn_wc__db_get_min_max_revisions(svn_rev
 
   return SVN_NO_ERROR;
 }
+
+
+svn_error_t *
+svn_wc__db_has_absent_children(svn_boolean_t *has_absent_children,
+                               svn_wc__db_t *db,
+                               const char *local_abspath,
+                               apr_pool_t *scratch_pool)
+{
+  svn_sqlite__stmt_t *stmt;
+  svn_wc__db_wcroot_t *wcroot;
+  const char *local_relpath;
+
+  SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
+
+  SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath,
+                                                db, local_abspath,
+                                                svn_sqlite__mode_readwrite,
+                                                scratch_pool, scratch_pool));
+  VERIFY_USABLE_WCROOT(wcroot);
+
+  SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+                                    STMT_SELECT_ABSENT_NODES));
+  SVN_ERR(svn_sqlite__bindf(stmt, "iss",
+                            wcroot->wc_id,
+                            local_relpath,
+                            construct_like_arg(local_relpath,
+                                               scratch_pool)));
+  /* If this query returns a row, there are one or more absent children. */
+  SVN_ERR(svn_sqlite__step(has_absent_children, stmt));
+  SVN_ERR(svn_sqlite__reset(stmt));
+
+  return SVN_NO_ERROR;
+}
+

Modified: subversion/trunk/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.h?rev=1076741&r1=1076740&r2=1076741&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.h Thu Mar  3 19:23:12 2011
@@ -2512,6 +2512,13 @@ svn_wc__db_get_min_max_revisions(svn_rev
                                  const char *local_abspath,
                                  apr_pool_t *scratch_pool);
 
+/* Indicate in *HAS_ABSENT_CHILDREN whether there are any absent children
+ * beneath LOCAL_ABSPATH in the working copy using DB. */
+svn_error_t *
+svn_wc__db_has_absent_children(svn_boolean_t *has_absent_children,
+                               svn_wc__db_t *db,
+                               const char *local_abspath,
+                               apr_pool_t *scratch_pool);
 
 /* @} */
 



Re: svn commit: r1076741 - in /subversion/trunk/subversion/libsvn_wc: revision_status.c wc_db.c wc_db.h

Posted by Stefan Sperling <st...@elego.de>.
On Fri, Mar 04, 2011 at 11:10:17AM +0000, Philip Martin wrote:
> stsp@apache.org writes:
> 
> > Author: stsp
> > Date: Thu Mar  3 19:23:12 2011
> > New Revision: 1076741
> >
> > URL: http://svn.apache.org/viewvc?rev=1076741&view=rev
> > Log:
> > Another step towards eliminating use of the node walker in
> > svn_wc_revision_status2(): use a DB query to determine if any absent
> > nodes are present in the working copy.
> 
> This makes merge_authz_tests.py 1 fail:

Oops! Thanks Philip. Should be fixed by r1078147.

> CMD: /home/pm/sw/subversion/obj/subversion/svn/svn merge -r4:8 svn://localhost/svn-test-work/repositories/merge_authz_tests-1/A svn-test-work/working_copies/merge_authz_tests-1.restricted/A_COPY_2 --config-dir /home/pm/sw/subversion/obj/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom exited with 1
> <TIME = 0.053927>
> ../src/subversion/svn/util.c:912: (apr_err=155010)
> ../src/subversion/libsvn_client/merge.c:10761: (apr_err=155010)
> ../src/subversion/libsvn_client/merge.c:10715: (apr_err=155010)
> ../src/subversion/libsvn_client/merge.c:10715: (apr_err=155010)
> ../src/subversion/libsvn_client/merge.c:10636: (apr_err=155010)
> ../src/subversion/libsvn_client/merge.c:8999: (apr_err=155010)
> ../src/subversion/libsvn_wc/revision_status.c:197: (apr_err=155010)
> ../src/subversion/libsvn_wc/node.c:740: (apr_err=155010)
> ../src/subversion/libsvn_wc/node.c:740: (apr_err=155010)
> ../src/subversion/libsvn_wc/node.c:740: (apr_err=155010)
> ../src/subversion/libsvn_wc/node.c:725: (apr_err=155010)
> ../src/subversion/libsvn_wc/revision_status.c:97: (apr_err=155010)
> ../src/subversion/libsvn_wc/update_editor.c:5174: (apr_err=155010)
> svn: E155010: The node '/home/pm/sw/subversion/obj/subversion/tests/cmdline/svn-test-work/working_copies/merge_authz_tests-1.restricted/A_COPY_2/D/G' was not found.
> 
> -- 
> Philip

Re: svn commit: r1076741 - in /subversion/trunk/subversion/libsvn_wc: revision_status.c wc_db.c wc_db.h

Posted by Philip Martin <ph...@wandisco.com>.
stsp@apache.org writes:

> Author: stsp
> Date: Thu Mar  3 19:23:12 2011
> New Revision: 1076741
>
> URL: http://svn.apache.org/viewvc?rev=1076741&view=rev
> Log:
> Another step towards eliminating use of the node walker in
> svn_wc_revision_status2(): use a DB query to determine if any absent
> nodes are present in the working copy.

This makes merge_authz_tests.py 1 fail:

CMD: /home/pm/sw/subversion/obj/subversion/svn/svn merge -r4:8 svn://localhost/svn-test-work/repositories/merge_authz_tests-1/A svn-test-work/working_copies/merge_authz_tests-1.restricted/A_COPY_2 --config-dir /home/pm/sw/subversion/obj/subversion/tests/cmdline/svn-test-work/local_tmp/config --password rayjandom --no-auth-cache --username jrandom exited with 1
<TIME = 0.053927>
../src/subversion/svn/util.c:912: (apr_err=155010)
../src/subversion/libsvn_client/merge.c:10761: (apr_err=155010)
../src/subversion/libsvn_client/merge.c:10715: (apr_err=155010)
../src/subversion/libsvn_client/merge.c:10715: (apr_err=155010)
../src/subversion/libsvn_client/merge.c:10636: (apr_err=155010)
../src/subversion/libsvn_client/merge.c:8999: (apr_err=155010)
../src/subversion/libsvn_wc/revision_status.c:197: (apr_err=155010)
../src/subversion/libsvn_wc/node.c:740: (apr_err=155010)
../src/subversion/libsvn_wc/node.c:740: (apr_err=155010)
../src/subversion/libsvn_wc/node.c:740: (apr_err=155010)
../src/subversion/libsvn_wc/node.c:725: (apr_err=155010)
../src/subversion/libsvn_wc/revision_status.c:97: (apr_err=155010)
../src/subversion/libsvn_wc/update_editor.c:5174: (apr_err=155010)
svn: E155010: The node '/home/pm/sw/subversion/obj/subversion/tests/cmdline/svn-test-work/working_copies/merge_authz_tests-1.restricted/A_COPY_2/D/G' was not found.

-- 
Philip