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/10/08 22:13:31 UTC
svn commit: r1006005 [6/10] - in /subversion/branches/object-model: ./
contrib/client-side/ notes/wc-ng/ subversion/bindings/javahl/native/
subversion/bindings/javahl/src/org/apache/subversion/javahl/
subversion/bindings/javahl/src/org/tigris/subversio...
Modified: subversion/branches/object-model/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_wc/wc_db.h?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/object-model/subversion/libsvn_wc/wc_db.h Fri Oct 8 20:13:26 2010
@@ -1142,6 +1142,11 @@ svn_wc__db_op_add_symlink(svn_wc__db_t *
To specify no properties, PROPS must be an empty hash, not NULL.
If the node is not present, return an error.
+ ### All the callers are doing a comparison against the current 'pristine'
+ props before calling this, and are passing NULL if the actual props
+ are to be the same as the pristine props. This behaviour should be
+ encapsulated.
+
CONFLICT is used to register a conflict on this node at the same time
the properties are changed.
@@ -1254,6 +1259,16 @@ svn_wc__db_op_mark_resolved(svn_wc__db_t
apr_pool_t *scratch_pool);
+/* Revert all local changes which are being maintained in the database,
+ * including conflict storage, properties and text modification status.
+ */
+svn_error_t *
+svn_wc__db_op_revert_actual(svn_wc__db_t *db,
+ const char *local_abspath,
+ apr_pool_t *scratch_pool);
+
+
+
svn_error_t *
svn_wc__db_op_revert(svn_wc__db_t *db,
const char *local_abspath,
Modified: subversion/branches/object-model/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/libsvn_wc/workqueue.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/object-model/subversion/libsvn_wc/workqueue.c Fri Oct 8 20:13:26 2010
@@ -206,8 +206,43 @@ run_revert(svn_wc__db_t *db,
db, local_abspath,
scratch_pool, scratch_pool));
- SVN_ERR(svn_wc__db_op_set_props(db, local_abspath, NULL, NULL, NULL,
- scratch_pool));
+ if (kind == svn_wc__db_kind_dir)
+ parent_abspath = local_abspath;
+ else
+ parent_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
+
+
+ if (conflicted)
+ {
+ const apr_array_header_t *conflicts;
+ int i;
+
+ SVN_ERR(svn_wc__db_read_conflicts(&conflicts, db, local_abspath,
+ scratch_pool, scratch_pool));
+
+ for (i = 0; i < conflicts->nelts; i++)
+ {
+ const svn_wc_conflict_description2_t *cd;
+
+ cd = APR_ARRAY_IDX(conflicts, i,
+ const svn_wc_conflict_description2_t *);
+
+ SVN_ERR(maybe_remove_conflict(parent_abspath, cd->base_file,
+ local_abspath, scratch_pool));
+ SVN_ERR(maybe_remove_conflict(parent_abspath, cd->their_file,
+ local_abspath, scratch_pool));
+ SVN_ERR(maybe_remove_conflict(parent_abspath, cd->my_file,
+ local_abspath, scratch_pool));
+ SVN_ERR(maybe_remove_conflict(parent_abspath, cd->merged_file,
+ local_abspath, scratch_pool));
+ }
+ }
+
+ /* Reverting the actual node destroys conflict markers and local props.
+ Don't use svn_wc__db_op_set_props() and svn_wc__db_op_mark_resolved()
+ because those leave a record in the ACTUALS table, which is a
+ performance issue. Besides, this does all that in one blow. */
+ SVN_ERR(svn_wc__db_op_revert_actual(db, local_abspath, scratch_pool));
/* Deal with the working file, as needed. */
if (kind == svn_wc__db_kind_file)
@@ -224,18 +259,8 @@ run_revert(svn_wc__db_t *db,
using the original base. */
reinstall_working = magic_changed || replaced;
- /* ### This "if (replaced)" looks very likely to be an artifact of the
- old WC-1 "revert-base and normal-base" system, and if so then it
- should go away. */
- if (replaced)
- {
- /* With the Pristine Store, there is no longer a "revert-base"
- text that needs to be moved to a "normal text-base" location.
-
- ### JAF: I wonder why the "revert-base" properties weren't being
- handled the same way in this same code path. An oversight? */
- }
- else if (!reinstall_working)
+ if (!replaced && !reinstall_working)
+ /* check for additional scenarios which need the actual re-installed */
{
svn_node_kind_t check_kind;
@@ -305,41 +330,6 @@ run_revert(svn_wc__db_t *db,
SVN_ERR(svn_io_dir_make(local_abspath, APR_OS_DEFAULT, scratch_pool));
}
- if (kind == svn_wc__db_kind_dir)
- parent_abspath = local_abspath;
- else
- parent_abspath = svn_dirent_dirname(local_abspath, scratch_pool);
-
- /* ### in wc-ng: the following block clears ACTUAL_NODE. */
- if (conflicted)
- {
- const apr_array_header_t *conflicts;
- int i;
-
- SVN_ERR(svn_wc__db_read_conflicts(&conflicts, db, local_abspath,
- scratch_pool, scratch_pool));
-
- for (i = 0; i < conflicts->nelts; i++)
- {
- const svn_wc_conflict_description2_t *cd;
-
- cd = APR_ARRAY_IDX(conflicts, i,
- const svn_wc_conflict_description2_t *);
-
- SVN_ERR(maybe_remove_conflict(parent_abspath, cd->base_file,
- local_abspath, scratch_pool));
- SVN_ERR(maybe_remove_conflict(parent_abspath, cd->their_file,
- local_abspath, scratch_pool));
- SVN_ERR(maybe_remove_conflict(parent_abspath, cd->my_file,
- local_abspath, scratch_pool));
- SVN_ERR(maybe_remove_conflict(parent_abspath, cd->merged_file,
- local_abspath, scratch_pool));
- }
-
- SVN_ERR(svn_wc__db_op_mark_resolved(db, local_abspath,
- TRUE, TRUE, FALSE,
- scratch_pool));
- }
{
svn_boolean_t is_wc_root;
Modified: subversion/branches/object-model/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/mod_authz_svn/mod_authz_svn.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/branches/object-model/subversion/mod_authz_svn/mod_authz_svn.c Fri Oct 8 20:13:26 2010
@@ -125,7 +125,7 @@ get_access_conf(request_rec *r, authz_sv
char errbuf[256];
cache_key = apr_pstrcat(r->pool, "mod_authz_svn:",
- conf->access_file, NULL);
+ conf->access_file, (char *)NULL);
apr_pool_userdata_get(&user_data, cache_key, r->connection->pool);
access_conf = user_data;
if (access_conf == NULL)
@@ -298,7 +298,8 @@ req_check_access(request_rec *r,
if (repos_path)
repos_path = svn_path_join("/", repos_path, r->pool);
- *repos_path_ref = apr_pstrcat(r->pool, repos_name, ":", repos_path, NULL);
+ *repos_path_ref = apr_pstrcat(r->pool, repos_name, ":", repos_path,
+ (char *)NULL);
if (r->method_number == M_MOVE || r->method_number == M_COPY)
{
@@ -346,7 +347,7 @@ req_check_access(request_rec *r,
dest_repos_path = svn_path_join("/", dest_repos_path, r->pool);
*dest_repos_path_ref = apr_pstrcat(r->pool, dest_repos_name, ":",
- dest_repos_path, NULL);
+ dest_repos_path, (char *)NULL);
}
/* Retrieve/cache authorization file */
Modified: subversion/branches/object-model/subversion/mod_dav_svn/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/mod_dav_svn/lock.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/mod_dav_svn/lock.c (original)
+++ subversion/branches/object-model/subversion/mod_dav_svn/lock.c Fri Oct 8 20:13:26 2010
@@ -91,7 +91,7 @@ svn_lock_to_dav_lock(dav_lock **dlock,
"<D:owner xmlns:D=\"DAV:\">",
apr_xml_quote_string(pool,
slock->comment, 1),
- "</D:owner>", NULL);
+ "</D:owner>", (char *)NULL);
}
else
{
@@ -133,7 +133,7 @@ unescape_xml(const char **output,
apr_xml_doc *xml_doc;
apr_status_t apr_err;
const char *xml_input = apr_pstrcat
- (pool, "<?xml version=\"1.0\" encoding=\"utf-8\"?>", input, NULL);
+ (pool, "<?xml version=\"1.0\" encoding=\"utf-8\"?>", input, (char *)NULL);
apr_err = apr_xml_parser_feed(xml_parser, xml_input, strlen(xml_input));
if (!apr_err)
Modified: subversion/branches/object-model/subversion/mod_dav_svn/mirror.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/mod_dav_svn/mirror.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/mod_dav_svn/mirror.c (original)
+++ subversion/branches/object-model/subversion/mod_dav_svn/mirror.c Fri Oct 8 20:13:26 2010
@@ -49,7 +49,8 @@ static void proxy_request_fixup(request_
r->filename = (char *) svn_path_uri_encode(apr_pstrcat(r->pool, "proxy:",
master_uri,
uri_segment,
- NULL), r->pool);
+ (char *)NULL),
+ r->pool);
r->handler = "proxy-server";
ap_add_output_filter("LocationRewrite", NULL, r, r->connection);
ap_add_output_filter("ReposRewrite", NULL, r, r->connection);
@@ -83,11 +84,11 @@ int dav_svn__proxy_request_fixup(request
r->method_number == M_GET) {
if ((seg = ap_strstr(r->uri, root_dir))) {
if (ap_strstr_c(seg, apr_pstrcat(r->pool, special_uri,
- "/wrk/", NULL))
+ "/wrk/", (char *)NULL))
|| ap_strstr_c(seg, apr_pstrcat(r->pool, special_uri,
- "/txn/", NULL))
+ "/txn/", (char *)NULL))
|| ap_strstr_c(seg, apr_pstrcat(r->pool, special_uri,
- "/txr/", NULL))) {
+ "/txr/", (char *)NULL))) {
seg += strlen(root_dir);
proxy_request_fixup(r, master_uri, seg);
}
@@ -239,7 +240,7 @@ apr_status_t dav_svn__location_header_fi
new_uri = ap_construct_url(r->pool,
apr_pstrcat(r->pool,
dav_svn__get_root_dir(r), "/",
- start_foo, NULL),
+ start_foo, (char *)NULL),
r);
new_uri = svn_path_uri_encode(new_uri, r->pool);
apr_table_set(r->headers_out, "Location", new_uri);
Modified: subversion/branches/object-model/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/mod_dav_svn/mod_dav_svn.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/object-model/subversion/mod_dav_svn/mod_dav_svn.c Fri Oct 8 20:13:26 2010
@@ -531,35 +531,39 @@ dav_svn__get_special_uri(request_rec *r)
const char *
dav_svn__get_me_resource_uri(request_rec *r)
{
- return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/me", NULL);
+ return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/me",
+ (char *)NULL);
}
const char *
dav_svn__get_rev_stub(request_rec *r)
{
- return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/rev", NULL);
+ return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/rev",
+ (char *)NULL);
}
const char *
dav_svn__get_rev_root_stub(request_rec *r)
{
- return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/rvr", NULL);
+ return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/rvr",
+ (char *)NULL);
}
const char *
dav_svn__get_txn_stub(request_rec *r)
{
- return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/txn", NULL);
+ return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/txn",
+ (char *)NULL);
}
const char *
dav_svn__get_txn_root_stub(request_rec *r)
{
- return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/txr", NULL);
+ return apr_pstrcat(r->pool, dav_svn__get_special_uri(r), "/txr", (char *)NULL);
}
Modified: subversion/branches/object-model/subversion/mod_dav_svn/reports/replay.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/mod_dav_svn/reports/replay.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/mod_dav_svn/reports/replay.c (original)
+++ subversion/branches/object-model/subversion/mod_dav_svn/reports/replay.c Fri Oct 8 20:13:26 2010
@@ -402,7 +402,7 @@ malformed_element_error(const char *tagn
"The request's '", tagname,
"' element is malformed; there "
"is a problem with the client.",
- NULL),
+ (char *)NULL),
SVN_DAV_ERROR_NAMESPACE, SVN_DAV_ERROR_TAG);
}
Modified: subversion/branches/object-model/subversion/mod_dav_svn/reports/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/mod_dav_svn/reports/update.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/branches/object-model/subversion/mod_dav_svn/reports/update.c Fri Oct 8 20:13:26 2010
@@ -250,7 +250,7 @@ absent_helper(svn_boolean_t is_dir,
"<S:absent-%s name=\"%s\"/>" DEBUG_CR,
DIR_OR_FILE(is_dir),
apr_xml_quote_string(pool,
- svn_relpath_basename(path, pool),
+ svn_relpath_basename(path, NULL),
1)));
}
@@ -409,8 +409,6 @@ open_helper(svn_boolean_t is_dir,
static svn_error_t *
close_helper(svn_boolean_t is_dir, item_baton_t *baton)
{
- int i;
-
if (baton->uc->resource_walk)
return SVN_NO_ERROR;
@@ -419,6 +417,7 @@ close_helper(svn_boolean_t is_dir, item_
if (baton->removed_props && (! baton->added || baton->copyfrom))
{
const char *qname;
+ int i;
for (i = 0; i < baton->removed_props->nelts; i++)
{
@@ -589,7 +588,7 @@ upd_delete_entry(const char *path,
{
item_baton_t *parent = parent_baton;
const char *qname = apr_xml_quote_string(pool,
- svn_relpath_basename(path, pool),
+ svn_relpath_basename(path, NULL),
1);
return dav_svn__brigade_printf(parent->uc->bb, parent->uc->output,
"<S:delete-entry name=\"%s\"/>" DEBUG_CR,
@@ -918,7 +917,8 @@ malformed_element_error(const char *tagn
{
const char *errstr = apr_pstrcat(pool, "The request's '", tagname,
"' element is malformed; there "
- "is a problem with the client.", NULL);
+ "is a problem with the client.",
+ (char *)NULL);
return dav_svn__new_error_tag(pool, HTTP_BAD_REQUEST, 0, errstr,
SVN_DAV_ERROR_NAMESPACE, SVN_DAV_ERROR_TAG);
}
Modified: subversion/branches/object-model/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/mod_dav_svn/repos.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/object-model/subversion/mod_dav_svn/repos.c Fri Oct 8 20:13:26 2010
@@ -1106,7 +1106,7 @@ create_private_resource(const dav_resour
/* versioned = baselined = working = FALSE */
comb->res.uri = apr_pstrcat(base->pool, base->info->repos->root_path,
- path->data, NULL);
+ path->data, (char *)NULL);
comb->res.info = &comb->priv;
comb->res.hooks = &dav_svn__hooks_repository;
comb->res.pool = base->pool;
@@ -1459,7 +1459,7 @@ get_parentpath_resource(request_rec *r,
if (r->uri[len-1] != '/')
{
new_uri = apr_pstrcat(r->pool, ap_escape_uri(r->pool, r->uri),
- "/", NULL);
+ "/", (char *)NULL);
apr_table_setn(r->headers_out, "Location",
ap_construct_url(r->pool, new_uri, r));
return dav_new_error(r->pool, HTTP_MOVED_PERMANENTLY, 0,
@@ -2090,7 +2090,7 @@ get_resource(request_rec *r,
}
/* Retrieve/cache open repository */
- repos_key = apr_pstrcat(r->pool, "mod_dav_svn:", fs_path, NULL);
+ repos_key = apr_pstrcat(r->pool, "mod_dav_svn:", fs_path, (char *)NULL);
apr_pool_userdata_get(&userdata, repos_key, r->connection->pool);
repos->repos = userdata;
if (repos->repos == NULL)
@@ -2253,7 +2253,7 @@ get_resource(request_rec *r,
"/",
r->args ? "?" : "",
r->args ? r->args : "",
- NULL);
+ (char *)NULL);
apr_table_setn(r->headers_out, "Location",
ap_construct_url(r->pool, new_path, r));
return dav_new_error(r->pool, HTTP_MOVED_PERMANENTLY, 0,
@@ -3338,7 +3338,7 @@ deliver(const dav_resource *resource, ap
/* ### The xml output doesn't like to see a trailing slash on
### the visible portion, so avoid that. */
if (is_dir)
- href = apr_pstrcat(entry_pool, href, "/", NULL);
+ href = apr_pstrcat(entry_pool, href, "/", (char *)NULL);
if (gen_html)
name = href;
@@ -4055,7 +4055,7 @@ do_walk(walker_ctx_t *ctx, int depth)
apr_pstrmemdup(iterpool,
ctx->repos_path->data,
ctx->repos_path->len),
- key, NULL);
+ key, (char *)NULL);
if (! dav_svn__allow_read(ctx->info.r, ctx->info.repos,
repos_relpath, ctx->info.root.rev,
iterpool))
@@ -4212,7 +4212,7 @@ dav_svn__create_working_resource(dav_res
/* collection = FALSE. ### not necessarily correct */
res->uri = apr_pstrcat(base->pool, base->info->repos->root_path,
- path, NULL);
+ path, (char *)NULL);
res->hooks = &dav_svn__hooks_repository;
res->pool = base->pool;
Modified: subversion/branches/object-model/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/object-model/subversion/mod_dav_svn/version.c?rev=1006005&r1=1006004&r2=1006005&view=diff
==============================================================================
--- subversion/branches/object-model/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/object-model/subversion/mod_dav_svn/version.c Fri Oct 8 20:13:26 2010
@@ -235,19 +235,19 @@ get_option(const dav_resource *resource,
apr_table_set(r->headers_out, SVN_DAV_ROOT_URI_HEADER, repos_root_uri);
apr_table_set(r->headers_out, SVN_DAV_ME_RESOURCE_HEADER,
apr_pstrcat(resource->pool, repos_root_uri, "/",
- dav_svn__get_me_resource_uri(r), NULL));
+ dav_svn__get_me_resource_uri(r), (char *)NULL));
apr_table_set(r->headers_out, SVN_DAV_REV_ROOT_STUB_HEADER,
apr_pstrcat(resource->pool, repos_root_uri, "/",
- dav_svn__get_rev_root_stub(r), NULL));
+ dav_svn__get_rev_root_stub(r), (char *)NULL));
apr_table_set(r->headers_out, SVN_DAV_REV_STUB_HEADER,
apr_pstrcat(resource->pool, repos_root_uri, "/",
- dav_svn__get_rev_stub(r), NULL));
+ dav_svn__get_rev_stub(r), (char *)NULL));
apr_table_set(r->headers_out, SVN_DAV_TXN_ROOT_STUB_HEADER,
apr_pstrcat(resource->pool, repos_root_uri, "/",
- dav_svn__get_txn_root_stub(r), NULL));
+ dav_svn__get_txn_root_stub(r), (char *)NULL));
apr_table_set(r->headers_out, SVN_DAV_TXN_STUB_HEADER,
apr_pstrcat(resource->pool, repos_root_uri, "/",
- dav_svn__get_txn_stub(r), NULL));
+ dav_svn__get_txn_stub(r), (char *)NULL));
}
return NULL;