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/10 16:25:02 UTC
svn commit: r1080248 - in /subversion/trunk/subversion:
libsvn_wc/wc-queries.sql libsvn_wc/wc_db.c tests/cmdline/svnversion_tests.py
Author: stsp
Date: Thu Mar 10 15:25:02 2011
New Revision: 1080248
URL: http://svn.apache.org/viewvc?rev=1080248&view=rev
Log:
Fix a regression introduced in r1079828. Working copies not coming from
the repository root were reported as switched.
* subversion/tests/cmdline/svnversion_tests.py
(non_reposroot_wc): Remove XFail marker.
* subversion/libsvn_wc/wc-queries.sql
(STMT_SELECT_SWITCHED_NODES): Do not check for switched status of the
working copy root, this is done in the C code. Note that this query
expects a slash for non-empty wcroot REPOS_PATHs.
* subversion/libsvn_wc/wc_db.c
(svn_wc__db_revision_status): While binding arguments to the
STMT_SELECT_SWITCHED_NODES query, append a slash to non-empty REPOS_PATHs
of the working copy root. Allows the query to match the path correctly
when concatenated with a LOCAL_RELPATH.
Modified:
subversion/trunk/subversion/libsvn_wc/wc-queries.sql
subversion/trunk/subversion/libsvn_wc/wc_db.c
subversion/trunk/subversion/tests/cmdline/svnversion_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=1080248&r1=1080247&r2=1080248&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/trunk/subversion/libsvn_wc/wc-queries.sql Thu Mar 10 15:25:02 2011
@@ -895,10 +895,12 @@ WHERE wc_id = ?1 AND (local_relpath = ?2
AND file_external IS NULL;
/* This query expects repos_path(wcroot)/% as arg 4,
- and repos_path(wcroot) as arg 5. */
+ and repos_path(wcroot), with a slash appended unless the path is empty,
+ as arg 5. */
-- STMT_SELECT_SWITCHED_NODES
SELECT local_relpath FROM nodes_base
-WHERE wc_id = ?1 AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
+WHERE wc_id = ?1 AND local_relpath != ""
+ AND (local_relpath = ?2 OR local_relpath LIKE ?3 ESCAPE '#')
AND ((repos_path NOT LIKE ?4 ESCAPE '#' AND repos_path != local_relpath)
OR (repos_path != ?5 || local_relpath))
AND file_external IS NULL;
Modified: subversion/trunk/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc_db.c?rev=1080248&r1=1080247&r2=1080248&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wc_db.c Thu Mar 10 15:25:02 2011
@@ -9212,7 +9212,10 @@ svn_wc__db_revision_status(svn_revnum_t
construct_like_arg(local_relpath, scratch_pool),
construct_like_arg(wcroot_repos_relpath,
scratch_pool),
- wcroot_repos_relpath));
+ wcroot_repos_relpath[0] == '\0' ?
+ "" : apr_pstrcat(scratch_pool,
+ wcroot_repos_relpath, "/",
+ (char *)NULL)));
/* If this query returns a row, some part of the working copy is switched. */
SVN_ERR(svn_sqlite__step(&have_row, stmt));
*is_switched = have_row;
Modified: subversion/trunk/subversion/tests/cmdline/svnversion_tests.py
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/tests/cmdline/svnversion_tests.py?rev=1080248&r1=1080247&r2=1080248&view=diff
==============================================================================
--- subversion/trunk/subversion/tests/cmdline/svnversion_tests.py (original)
+++ subversion/trunk/subversion/tests/cmdline/svnversion_tests.py Thu Mar 10 15:25:02 2011
@@ -305,8 +305,6 @@ def committed_revisions(sbox):
[ "1:2\n" ], [],
"--committed")
-# This was probably broken by r1079828, stsp is investigating...
-@XFail()
def non_reposroot_wc(sbox):
"test 'svnversion' on a non-repos-root working copy"
sbox.build(create_wc=False)