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 2010/09/24 22:56:55 UTC
svn commit: r1001071 - in /subversion/branches/object-model: ./
subversion/bindings/javahl/native/ subversion/include/
subversion/libsvn_wc/ tools/client-side/svnmucc/
Author: hwright
Date: Fri Sep 24 20:56:55 2010
New Revision: 1001071
URL: http://svn.apache.org/viewvc?rev=1001071&view=rev
Log:
On the object-model branch:
Bring up-to-date with trunk (to pick up recent JavaHL changes).
Modified:
subversion/branches/object-model/ (props changed)
subversion/branches/object-model/subversion/bindings/javahl/native/BlameCallback.cpp
subversion/branches/object-model/subversion/bindings/javahl/native/ClientContext.cpp
subversion/branches/object-model/subversion/bindings/javahl/native/CreateJ.cpp
subversion/branches/object-model/subversion/bindings/javahl/native/CreateJ.h
subversion/branches/object-model/subversion/bindings/javahl/native/LogMessageCallback.cpp
subversion/branches/object-model/subversion/bindings/javahl/native/ProplistCallback.cpp
subversion/branches/object-model/subversion/bindings/javahl/native/ReposNotifyCallback.cpp
subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.cpp
subversion/branches/object-model/subversion/include/svn_io.h
subversion/branches/object-model/subversion/libsvn_wc/copy.c
subversion/branches/object-model/subversion/libsvn_wc/wc-queries.sql
subversion/branches/object-model/subversion/libsvn_wc/wc_db.c
subversion/branches/object-model/tools/client-side/svnmucc/svnmucc-test.py
Propchange: subversion/branches/object-model/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Sep 24 20:56:55 2010
@@ -38,4 +38,4 @@
/subversion/branches/tc_url_rev:874351-874483
/subversion/branches/tree-conflicts:868291-873154
/subversion/branches/tree-conflicts-notify:873926-874008
-/subversion/trunk:997486-1000870
+/subversion/trunk:997486-1001067
Modified: subversion/branches/object-model/subversion/bindings/javahl/native/BlameCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/native/BlameCallback.cpp?rev=1001071&r1=1001070&r2=1001071&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/native/BlameCallback.cpp (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/native/BlameCallback.cpp Fri Sep 24 20:56:55 2010
@@ -106,14 +106,14 @@ BlameCallback::singleLine(svn_revnum_t s
}
// convert the parameters to their Java relatives
- jobject jrevProps = CreateJ::PropertyMap(revProps, pool);
+ jobject jrevProps = CreateJ::PropertyMap(revProps);
if (JNIUtil::isJavaExceptionThrown())
POP_AND_RETURN(SVN_NO_ERROR);
jobject jmergedRevProps = NULL;
if (mergedRevProps != NULL)
{
- jmergedRevProps = CreateJ::PropertyMap(mergedRevProps, pool);
+ jmergedRevProps = CreateJ::PropertyMap(mergedRevProps);
if (JNIUtil::isJavaExceptionThrown())
POP_AND_RETURN(SVN_NO_ERROR);
}
Modified: subversion/branches/object-model/subversion/bindings/javahl/native/ClientContext.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/native/ClientContext.cpp?rev=1001071&r1=1001070&r2=1001071&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/native/ClientContext.cpp (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/native/ClientContext.cpp Fri Sep 24 20:56:55 2010
@@ -311,7 +311,7 @@ ClientContext::notify(void *baton,
env->DeleteLocalRef(clazz);
}
- jobject jInfo = CreateJ::ClientNotifyInformation(notify, pool);
+ jobject jInfo = CreateJ::ClientNotifyInformation(notify);
if (JNIUtil::isJavaExceptionThrown())
return;
Modified: subversion/branches/object-model/subversion/bindings/javahl/native/CreateJ.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/native/CreateJ.cpp?rev=1001071&r1=1001070&r2=1001071&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/native/CreateJ.cpp (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/native/CreateJ.cpp Fri Sep 24 20:56:55 2010
@@ -671,8 +671,7 @@ CreateJ::Status(svn_wc_context_t *wc_ctx
}
jobject
-CreateJ::ClientNotifyInformation(const svn_wc_notify_t *wcNotify,
- apr_pool_t *pool)
+CreateJ::ClientNotifyInformation(const svn_wc_notify_t *wcNotify)
{
JNIEnv *env = JNIUtil::getEnv();
@@ -762,7 +761,7 @@ CreateJ::ClientNotifyInformation(const s
if (JNIUtil::isJavaExceptionThrown())
POP_AND_RETURN_NULL;
- jobject jrevProps = CreateJ::PropertyMap(wcNotify->rev_props, pool);
+ jobject jrevProps = CreateJ::PropertyMap(wcNotify->rev_props);
if (JNIUtil::isJavaExceptionThrown())
POP_AND_RETURN_NULL;
@@ -791,8 +790,7 @@ CreateJ::ClientNotifyInformation(const s
}
jobject
-CreateJ::ReposNotifyInformation(const svn_repos_notify_t *reposNotify,
- apr_pool_t *pool)
+CreateJ::ReposNotifyInformation(const svn_repos_notify_t *reposNotify)
{
JNIEnv *env = JNIUtil::getEnv();
@@ -1032,7 +1030,7 @@ CreateJ::StringSet(apr_array_header_t *s
return CreateJ::Set(jstrs);
}
-jobject CreateJ::PropertyMap(apr_hash_t *prop_hash, apr_pool_t *pool)
+jobject CreateJ::PropertyMap(apr_hash_t *prop_hash)
{
JNIEnv *env = JNIUtil::getEnv();
@@ -1072,7 +1070,8 @@ jobject CreateJ::PropertyMap(apr_hash_t
apr_hash_index_t *hi;
int i = 0;
- for (hi = apr_hash_first(pool, prop_hash); hi; hi = apr_hash_next(hi), ++i)
+ for (hi = apr_hash_first(apr_hash_pool_get(prop_hash), prop_hash);
+ hi; hi = apr_hash_next(hi), ++i)
{
const char *key;
svn_string_t *val;
Modified: subversion/branches/object-model/subversion/bindings/javahl/native/CreateJ.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/native/CreateJ.h?rev=1001071&r1=1001070&r2=1001071&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/native/CreateJ.h (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/native/CreateJ.h Fri Sep 24 20:56:55 2010
@@ -59,10 +59,10 @@ class CreateJ
const svn_client_status_t *status, apr_pool_t *pool);
static jobject
- ClientNotifyInformation(const svn_wc_notify_t *notify, apr_pool_t *pool);
+ ClientNotifyInformation(const svn_wc_notify_t *notify);
static jobject
- ReposNotifyInformation(const svn_repos_notify_t *notify, apr_pool_t *pool);
+ ReposNotifyInformation(const svn_repos_notify_t *notify);
static jobject
CommitItem(svn_client_commit_item3_t *item);
@@ -77,7 +77,7 @@ class CreateJ
StringSet(apr_array_header_t *strings);
static jobject
- PropertyMap(apr_hash_t *prop_hash, apr_pool_t *pool);
+ PropertyMap(apr_hash_t *prop_hash);
/* This creates a set of Objects. It derefs the members of the vector
* after putting them in the set, so they caller doesn't need to. */
Modified: subversion/branches/object-model/subversion/bindings/javahl/native/LogMessageCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/native/LogMessageCallback.cpp?rev=1001071&r1=1001070&r2=1001071&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/native/LogMessageCallback.cpp (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/native/LogMessageCallback.cpp Fri Sep 24 20:56:55 2010
@@ -115,7 +115,7 @@ LogMessageCallback::singleMessage(svn_lo
jobject jrevprops = NULL;
if (log_entry->revprops != NULL && apr_hash_count(log_entry->revprops) > 0)
- jrevprops = CreateJ::PropertyMap(log_entry->revprops, pool);
+ jrevprops = CreateJ::PropertyMap(log_entry->revprops);
env->CallVoidMethod(m_callback,
sm_mid,
Modified: subversion/branches/object-model/subversion/bindings/javahl/native/ProplistCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/native/ProplistCallback.cpp?rev=1001071&r1=1001070&r2=1001071&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/native/ProplistCallback.cpp (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/native/ProplistCallback.cpp Fri Sep 24 20:56:55 2010
@@ -96,7 +96,7 @@ svn_error_t *ProplistCallback::singlePat
if (JNIUtil::isJavaExceptionThrown())
POP_AND_RETURN(SVN_NO_ERROR);
- jobject jmap = CreateJ::PropertyMap(prop_hash, pool);
+ jobject jmap = CreateJ::PropertyMap(prop_hash);
if (JNIUtil::isJavaExceptionThrown())
POP_AND_RETURN(SVN_NO_ERROR);
Modified: subversion/branches/object-model/subversion/bindings/javahl/native/ReposNotifyCallback.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/native/ReposNotifyCallback.cpp?rev=1001071&r1=1001070&r2=1001071&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/native/ReposNotifyCallback.cpp (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/native/ReposNotifyCallback.cpp Fri Sep 24 20:56:55 2010
@@ -81,7 +81,7 @@ ReposNotifyCallback::onNotify(const svn_
env->DeleteLocalRef(clazz);
}
- jobject jInfo = CreateJ::ReposNotifyInformation(wcNotify, pool);
+ jobject jInfo = CreateJ::ReposNotifyInformation(wcNotify);
if (JNIUtil::isJavaExceptionThrown())
return;
Modified: subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.cpp
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.cpp?rev=1001071&r1=1001070&r2=1001071&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.cpp (original)
+++ subversion/branches/object-model/subversion/bindings/javahl/native/SVNClient.cpp Fri Sep 24 20:56:55 2010
@@ -1356,7 +1356,7 @@ jobject SVNClient::revProperties(const c
&set_rev, ctx, requestPool.pool()),
NULL);
- return CreateJ::PropertyMap(props, requestPool.pool());
+ return CreateJ::PropertyMap(props);
}
struct info_baton
Modified: subversion/branches/object-model/subversion/include/svn_io.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/include/svn_io.h?rev=1001071&r1=1001070&r2=1001071&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/include/svn_io.h (original)
+++ subversion/branches/object-model/subversion/include/svn_io.h Fri Sep 24 20:56:55 2010
@@ -248,7 +248,10 @@ svn_io_open_uniquely_named(apr_file_t **
* be possible to atomically rename the resulting file due to cross-device
* issues.)
*
- * The file will be deleted according to @a delete_when.
+ * The file will be deleted according to @a delete_when. If @a delete_when
+ * is @c svn_io_file_del_on_close and @a file is @c NULL, the file will be
+ * deleted before this function returns.
+ *
* When passing @c svn_io_file_del_none please don't forget to eventually
* remove the temporary file to avoid filling up the system temp directory.
* It is often appropriate to bind the lifetime of the temporary file to
Modified: subversion/branches/object-model/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_wc/copy.c?rev=1001071&r1=1001070&r2=1001071&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/object-model/subversion/libsvn_wc/copy.c Fri Sep 24 20:56:55 2010
@@ -89,15 +89,16 @@ copy_to_tmpdir(const char **dst_abspath,
### handle the directory case and b) we need to be able to remove
### the cleanup before queueing the move work item. */
+ /* Set DST_ABSPATH to a temporary unique path. If *KIND is file, leave a
+ file there and then overwrite it; otherwise leave no node on disk at
+ that path. In the latter case, something else might use that path
+ before we get around to using it a moment later, but never mind. */
SVN_ERR(svn_io_open_unique_file3(NULL, dst_abspath, tmpdir_abspath,
delete_when, scratch_pool, scratch_pool));
if (*kind == svn_node_dir)
{
if (recursive)
- /* ### Huh? This looks like it's expected to overwrite the temp file
- *DST_ABSPATH, but it would return an error if the destination
- exists. And same for svn_io_dir_make() below. What gives? */
SVN_ERR(svn_io_copy_dir_recursively(src_abspath,
tmpdir_abspath,
svn_dirent_basename(*dst_abspath,
@@ -448,6 +449,8 @@ svn_wc_copy3(svn_wc_context_t *wc_ctx,
dstdir_abspath = svn_dirent_dirname(dst_abspath, scratch_pool);
+ /* Ensure DSTDIR_ABSPATH belongs to the same repository as SRC_ABSPATH;
+ throw an error if not. */
{
svn_wc__db_status_t src_status, dstdir_status;
const char *src_repos_root_url, *dst_repos_root_url;
Modified: subversion/branches/object-model/subversion/libsvn_wc/wc-queries.sql
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_wc/wc-queries.sql?rev=1001071&r1=1001070&r2=1001071&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_wc/wc-queries.sql (original)
+++ subversion/branches/object-model/subversion/libsvn_wc/wc-queries.sql Fri Sep 24 20:56:55 2010
@@ -660,6 +660,18 @@ WHERE wc_id = ?1 AND local_relpath = ?2
UPDATE working_node SET copyfrom_repos_id = ?3, copyfrom_repos_path = ?4
WHERE wc_id = ?1 AND local_relpath = ?2;
+-- STMT_SELECT_CHILDREN_OP_DEPTH_RECURSIVE
+SELECT local_relpath, op_depth FROM nodes as node
+WHERE wc_id = ?1 AND local_relpath LIKE ?2 ESCAPE '#'
+ AND op_depth = (SELECT MAX(op_depth) FROM nodes
+ WHERE wc_id = node.wc_id
+ AND local_relpath = node.local_relpath);
+
+-- STMT_UPDATE_OP_DEPTH
+UPDATE nodes SET op_depth = ?4
+WHERE wc_id = ?1 AND local_relpath = ?2 AND op_depth = ?3;
+
+
-- STMT_UPDATE_COPYFROM_TO_INHERIT
UPDATE working_node SET
copyfrom_repos_id = NULL,
Modified: subversion/branches/object-model/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_wc/wc_db.c?rev=1001071&r1=1001070&r2=1001071&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/object-model/subversion/libsvn_wc/wc_db.c Fri Sep 24 20:56:55 2010
@@ -274,6 +274,18 @@ escape_sqlite_like(const char * const st
return result;
}
+static const char *construct_like_arg(const char *local_relpath,
+ apr_pool_t *scratch_pool)
+{
+ if (local_relpath[0] == '\0')
+ return "%";
+
+ return apr_pstrcat(scratch_pool,
+ escape_sqlite_like(local_relpath, scratch_pool),
+ "/%", NULL);
+}
+
+
/* Returns in PRISTINE_ABSPATH a new string allocated from RESULT_POOL,
holding the local absolute path to the file location that is dedicated
@@ -933,6 +945,11 @@ blank_iwb(insert_working_baton_t *piwb)
}
+struct relpath_op_depth_t {
+ const char *local_relpath;
+ apr_int64_t op_depth;
+};
+
/* Copy the row specified by BATON->(wc_id,local_relpath) from BASE to
* WORKING, changing its 'presence' and 'op_depth' to the values in BATON. */
static svn_error_t *
@@ -944,6 +961,10 @@ copy_working_from_base(void *baton,
svn_sqlite__stmt_t *stmt;
#ifdef SVN_WC__NODES
+ const char *like_arg;
+ svn_boolean_t have_row;
+ apr_array_header_t *nodes;
+ int i;
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_INSERT_WORKING_NODE_FROM_BASE));
@@ -953,6 +974,35 @@ copy_working_from_base(void *baton,
presence_map, piwb->presence));
SVN_ERR(svn_sqlite__insert(NULL, stmt));
+ /* Need to update the op_depth of all deleted children. A single
+ query can locate all the rows, but not update them, so we fall
+ back on one update per row. */
+ like_arg = construct_like_arg(piwb->local_relpath, scratch_pool);
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+ STMT_SELECT_CHILDREN_OP_DEPTH_RECURSIVE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", piwb->wc_id, like_arg));
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+ nodes = apr_array_make(scratch_pool, 10, sizeof(struct relpath_op_depth_t *));
+ while (have_row)
+ {
+ struct relpath_op_depth_t *rod = apr_palloc(scratch_pool, sizeof(*rod));
+ rod->local_relpath = svn_sqlite__column_text(stmt, 0, scratch_pool);
+ rod->op_depth = svn_sqlite__column_int64(stmt, 1);
+ APR_ARRAY_PUSH(nodes, struct relpath_op_depth_t *) = rod;
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+ }
+ SVN_ERR(svn_sqlite__reset(stmt));
+ for (i = 0; i < nodes->nelts; ++i)
+ {
+ struct relpath_op_depth_t *rod
+ = APR_ARRAY_IDX(nodes, i, struct relpath_op_depth_t *);
+
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_UPDATE_OP_DEPTH));
+ SVN_ERR(svn_sqlite__bindf(stmt, "isii",
+ piwb->wc_id, rod->local_relpath, rod->op_depth,
+ piwb->op_depth));
+ SVN_ERR(svn_sqlite__update(NULL, stmt));
+ }
#endif
#ifndef SVN_WC__NODES_ONLY
@@ -2659,12 +2709,7 @@ svn_wc__db_base_clear_dav_cache_recursiv
scratch_pool, scratch_pool));
VERIFY_USABLE_PDH(pdh);
- if (local_relpath[0] == 0)
- like_arg = "%";
- else
- like_arg = apr_pstrcat(scratch_pool,
- escape_sqlite_like(local_relpath, scratch_pool),
- "/%", NULL);
+ like_arg = construct_like_arg(local_relpath, scratch_pool);
#ifndef SVN_WC__NODES_ONLY
SVN_ERR(svn_sqlite__get_statement(&stmt, pdh->wcroot->sdb,
@@ -4810,8 +4855,7 @@ db_working_insert(svn_wc__db_status_t st
iwb.wc_id = pdh->wcroot->wc_id;
iwb.local_relpath = local_relpath;
iwb.presence = status;
- /* ### NODE_DATA we temporary store 1 or 2 */
- iwb.op_depth = (*local_relpath == '\0') ? 1 : 2;
+ iwb.op_depth = relpath_depth(local_relpath);
SVN_ERR(svn_sqlite__with_transaction(pdh->wcroot->sdb,
copy_working_from_base, &iwb,
@@ -5670,12 +5714,7 @@ relocate_txn(void *baton, svn_sqlite__db
SVN_ERR(create_repos_id(&new_repos_id, rb->repos_root_url, rb->repos_uuid,
sdb, scratch_pool));
- if (rb->local_relpath[0] == 0)
- like_arg = "%";
- else
- like_arg = apr_pstrcat(scratch_pool,
- escape_sqlite_like(rb->local_relpath, scratch_pool),
- "/%", NULL);
+ like_arg = construct_like_arg(rb->local_relpath, scratch_pool);
#ifndef SVN_WC__NODES_ONLY
/* Update non-NULL WORKING_NODE.copyfrom_repos_id. */
@@ -5718,12 +5757,7 @@ relocate_txn(void *baton, svn_sqlite__db
#endif
/* Update any locks for the root or its children. */
- if (rb->repos_relpath[0] == 0)
- like_arg = "%";
- else
- like_arg = apr_pstrcat(scratch_pool,
- escape_sqlite_like(rb->repos_relpath, scratch_pool),
- "/%", NULL);
+ like_arg = construct_like_arg(rb->repos_relpath, scratch_pool);
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_UPDATE_LOCK_REPOS_ID));
Modified: subversion/branches/object-model/tools/client-side/svnmucc/svnmucc-test.py
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/tools/client-side/svnmucc/svnmucc-test.py?rev=1001071&r1=1001070&r2=1001071&view=diff
==============================================================================
--- subversion/branches/object-model/tools/client-side/svnmucc/svnmucc-test.py (original)
+++ subversion/branches/object-model/tools/client-side/svnmucc/svnmucc-test.py Fri Sep 24 20:56:55 2010
@@ -34,6 +34,10 @@ this_dir = os.path.dirname(os.path.abspa
sys.path.insert(0, '%s/../../../subversion/tests/cmdline' % (this_dir))
import svntest
+# setup the global 'svntest.main.options' object so functions in the
+# module don't freak out.
+svntest.main._parse_options(arglist=[])
+
# calculate the top of the build tree
if len(sys.argv) > 1:
build_top = os.path.abspath(sys.argv[1])
@@ -275,6 +279,13 @@ def main():
run_svnmucc(['M /foo/bar'], #---------
'propdel', 'testprop', 'foo/bar')
+ # revision 18
+ run_svnmucc(['M /foo/z.c',
+ 'M /foo/foo',
+ ], #---------
+ 'propset', 'testprop', 'true', 'foo/z.c',
+ 'propset', 'testprop', 'true', 'foo/foo')
+
# Expected missing revision error
xrun_svnmucc(['svnmucc: \'a\' is not a revision'
], #---------