You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2013/08/19 14:07:58 UTC
svn commit: r1515380 [10/15] - in /subversion/branches/move-tracking-1: ./
build/ac-macros/ build/generator/ build/generator/swig/
build/generator/templates/ contrib/client-side/emacs/ doc/programmer/
notes/http-and-webdav/ subversion/ subversion/bindi...
Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db.c Mon Aug 19 12:07:51 2013
@@ -27,6 +27,7 @@
#include <apr_pools.h>
#include <apr_hash.h>
+#include "svn_private_config.h"
#include "svn_types.h"
#include "svn_error.h"
#include "svn_dirent_uri.h"
@@ -48,7 +49,6 @@
#include "workqueue.h"
#include "token-map.h"
-#include "svn_private_config.h"
#include "private/svn_sqlite.h"
#include "private/svn_skel.h"
#include "private/svn_wc_private.h"
@@ -1529,7 +1529,6 @@ svn_wc__db_init(svn_wc__db_t *db,
apr_pstrdup(db->state_pool, local_abspath),
sdb, wc_id, FORMAT_FROM_SDB,
FALSE /* auto-upgrade */,
- FALSE /* enforce_empty_wq */,
db->state_pool, scratch_pool));
/* The WCROOT is complete. Stash it into DB. */
@@ -12300,7 +12299,6 @@ svn_wc__db_upgrade_begin(svn_sqlite__db_
dir_abspath),
*sdb, *wc_id, FORMAT_FROM_SDB,
FALSE /* auto-upgrade */,
- FALSE /* enforce_empty_wq */,
wc_db->state_pool, scratch_pool));
/* The WCROOT is complete. Stash it into DB. */
@@ -13505,6 +13503,7 @@ wclock_obtain_cb(svn_wc__db_wcroot_t *wc
const char *local_relpath,
int levels_to_lock,
svn_boolean_t steal_lock,
+ svn_boolean_t enforce_empty_wq,
apr_pool_t *scratch_pool)
{
svn_sqlite__stmt_t *stmt;
@@ -13534,6 +13533,9 @@ wclock_obtain_cb(svn_wc__db_wcroot_t *wc
scratch_pool));
}
+ if (enforce_empty_wq)
+ SVN_ERR(svn_wc__db_verify_no_work(wcroot->sdb));
+
/* Check if there are nodes locked below the new lock root */
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_FIND_WC_LOCK));
SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
@@ -13708,7 +13710,7 @@ svn_wc__db_wclock_obtain(svn_wc__db_t *d
SVN_WC__DB_WITH_TXN(
wclock_obtain_cb(wcroot, local_relpath, levels_to_lock, steal_lock,
- scratch_pool),
+ db->enforce_empty_wq, scratch_pool),
wcroot);
return SVN_NO_ERROR;
}
Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db.h?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db.h Mon Aug 19 12:07:51 2013
@@ -2124,7 +2124,7 @@ svn_wc__db_read_pristine_props(apr_hash_
* paths relative to the repository root URL for cached inherited
* properties and absolute working copy paths otherwise.
*
- * If ACTUAL_PROPS is not NULL, then set *ACTUAL_PROPS to the actual
+ * If ACTUAL_PROPS is not NULL, then set *ACTUAL_PROPS to ALL the actual
* properties stored on LOCAL_ABSPATH.
*
* Allocate @a *iprops in @a result_pool. Use @a scratch_pool
Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db_private.h?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db_private.h Mon Aug 19 12:07:51 2013
@@ -42,7 +42,8 @@ struct svn_wc__db_t {
opened, and found to be not-current? */
svn_boolean_t verify_format;
- /* Should we ensure the WORK_QUEUE is empty when a WCROOT is opened? */
+ /* Should we ensure the WORK_QUEUE is empty when a DB is locked
+ * for writing? */
svn_boolean_t enforce_empty_wq;
/* Should we open Sqlite databases EXCLUSIVE */
@@ -122,7 +123,6 @@ svn_wc__db_pdh_create_wcroot(svn_wc__db_
apr_int64_t wc_id,
int format,
svn_boolean_t verify_format,
- svn_boolean_t enforce_empty_wq,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
@@ -145,6 +145,9 @@ svn_wc__db_wcroot_parse_local_abspath(sv
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/* Return an error if the work queue in SDB is non-empty. */
+svn_error_t *
+svn_wc__db_verify_no_work(svn_sqlite__db_t *sdb);
/* Assert that the given WCROOT is usable.
NOTE: the expression is multiply-evaluated!! */
Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db_update_move.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db_update_move.c Mon Aug 19 12:07:51 2013
@@ -78,6 +78,7 @@
#include <assert.h>
+#include "svn_private_config.h"
#include "svn_checksum.h"
#include "svn_dirent_uri.h"
#include "svn_error.h"
Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db_wcroot.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db_wcroot.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db_wcroot.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/wc_db_wcroot.c Mon Aug 19 12:07:51 2013
@@ -25,6 +25,7 @@
#include <assert.h>
+#include "svn_private_config.h"
#include "svn_dirent_uri.h"
#include "svn_hash.h"
#include "svn_path.h"
@@ -35,8 +36,6 @@
#include "wc_db_private.h"
#include "wc-queries.h"
-#include "svn_private_config.h"
-
/* ### Same values as wc_db.c */
#define SDB_FILE "wc.db"
#define UNKNOWN_WC_ID ((apr_int64_t) -1)
@@ -145,9 +144,8 @@ get_path_kind(svn_node_kind_t *kind,
}
-/* Return an error if the work queue in SDB is non-empty. */
-static svn_error_t *
-verify_no_work(svn_sqlite__db_t *sdb)
+svn_error_t *
+svn_wc__db_verify_no_work(svn_sqlite__db_t *sdb)
{
svn_sqlite__stmt_t *stmt;
svn_boolean_t have_row;
@@ -258,7 +256,6 @@ svn_wc__db_pdh_create_wcroot(svn_wc__db_
apr_int64_t wc_id,
int format,
svn_boolean_t verify_format,
- svn_boolean_t enforce_empty_wq,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -293,11 +290,11 @@ svn_wc__db_pdh_create_wcroot(svn_wc__db_
}
/* Verify that no work items exists. If they do, then our integrity is
- suspect and, thus, we cannot use this database. */
- if (format >= SVN_WC__HAS_WORK_QUEUE
- && (enforce_empty_wq || (format < SVN_WC__VERSION && verify_format)))
+ suspect and, thus, we cannot upgrade this database. */
+ if (format >= SVN_WC__HAS_WORK_QUEUE &&
+ format < SVN_WC__VERSION && verify_format)
{
- svn_error_t *err = verify_no_work(sdb);
+ svn_error_t *err = svn_wc__db_verify_no_work(sdb);
if (err)
{
/* Special message for attempts to upgrade a 1.7-dev wc with
@@ -678,7 +675,7 @@ try_symlink_as_dir:
? symlink_wcroot_abspath
: local_abspath),
sdb, wc_id, FORMAT_FROM_SDB,
- db->verify_format, db->enforce_empty_wq,
+ db->verify_format,
db->state_pool, scratch_pool);
if (err && (err->apr_err == SVN_ERR_WC_UNSUPPORTED_FORMAT ||
err->apr_err == SVN_ERR_WC_UPGRADE_REQUIRED) &&
@@ -749,7 +746,7 @@ try_symlink_as_dir:
? symlink_wcroot_abspath
: local_abspath),
NULL, UNKNOWN_WC_ID, wc_format,
- db->verify_format, db->enforce_empty_wq,
+ db->verify_format,
db->state_pool, scratch_pool));
}
Modified: subversion/branches/move-tracking-1/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/libsvn_wc/workqueue.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/move-tracking-1/subversion/libsvn_wc/workqueue.c Mon Aug 19 12:07:51 2013
@@ -23,6 +23,7 @@
#include <apr_pools.h>
+#include "svn_private_config.h"
#include "svn_types.h"
#include "svn_pools.h"
#include "svn_dirent_uri.h"
@@ -37,7 +38,6 @@
#include "conflicts.h"
#include "translate.h"
-#include "svn_private_config.h"
#include "private/svn_skel.h"
Modified: subversion/branches/move-tracking-1/subversion/mod_authz_svn/mod_authz_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/mod_authz_svn/mod_authz_svn.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/mod_authz_svn/mod_authz_svn.c (original)
+++ subversion/branches/move-tracking-1/subversion/mod_authz_svn/mod_authz_svn.c Mon Aug 19 12:07:51 2013
@@ -806,14 +806,15 @@ access_checker(request_rec *r)
&authz_svn_module);
const char *repos_path = NULL;
const char *dest_repos_path = NULL;
- int status;
+ int status, authn_required;
/* We are not configured to run */
if (!conf->anonymous
|| (! (conf->access_file || conf->repo_relative_access_file)))
return DECLINED;
- if (ap_some_auth_required(r))
+ authn_required = ap_some_auth_required(r);
+ if (authn_required)
{
/* It makes no sense to check if a location is both accessible
* anonymous and by an authenticated user (in the same request!).
@@ -843,7 +844,7 @@ access_checker(request_rec *r)
if (!conf->authoritative)
return DECLINED;
- if (!ap_some_auth_required(r))
+ if (!authn_required)
log_access_verdict(APLOG_MARK, r, 0, repos_path, dest_repos_path);
return HTTP_FORBIDDEN;
Modified: subversion/branches/move-tracking-1/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/mod_dav_svn/mod_dav_svn.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/move-tracking-1/subversion/mod_dav_svn/mod_dav_svn.c Mon Aug 19 12:07:51 2013
@@ -979,7 +979,6 @@ merge_xml_filter_insert(request_rec *r)
typedef struct merge_ctx_t {
apr_bucket_brigade *bb;
apr_xml_parser *parser;
- apr_pool_t *pool;
} merge_ctx_t;
@@ -1009,7 +1008,6 @@ merge_xml_in_filter(ap_filter_t *f,
f->ctx = ctx = apr_palloc(r->pool, sizeof(*ctx));
ctx->parser = apr_xml_parser_create(r->pool);
ctx->bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
- apr_pool_create(&ctx->pool, r->pool);
}
rv = ap_get_brigade(f->next, ctx->bb, mode, block, readbytes);
@@ -1094,7 +1092,41 @@ static int dav_svn__handler(request_rec
return DECLINED;
}
+#define NO_MAP_TO_STORAGE_NOTE "dav_svn-no-map-to-storage"
+/* Prevent filename on the request from being set since we aren't serving a
+ * file off the disk. This means that <Directory> blocks will not match and
+ * that * %f in logging formats will show as "-". */
+static int dav_svn__translate_name(request_rec *r)
+{
+ dir_conf_t *conf = ap_get_module_config(r->per_dir_config, &dav_svn_module);
+
+ /* module is not configured, bail out early */
+ if (!conf->fs_path && !conf->fs_parent_path)
+ return DECLINED;
+
+ /* Be paranoid and set it to NULL just in case some other module set it
+ * before we got called. */
+ r->filename = NULL;
+
+ /* Leave a note to ourselves so that we know not to decline in the
+ * map_to_storage hook. */
+ apr_table_setn(r->notes, NO_MAP_TO_STORAGE_NOTE, (const char*)1);
+ return OK;
+}
+
+/* Prevent core_map_to_storage from running if we prevented the r->filename
+ * from being set since core_map_to_storage doesn't like r->filename being
+ * NULL. */
+static int dav_svn__map_to_storage(request_rec *r)
+{
+ /* Check a note we left in translate_name since map_to_storage doesn't
+ * have access to our configuration. */
+ if (apr_table_get(r->notes, NO_MAP_TO_STORAGE_NOTE))
+ return OK;
+
+ return DECLINED;
+}
@@ -1268,6 +1300,12 @@ register_hooks(apr_pool_t *pconf)
ap_register_input_filter("IncomingRewrite", dav_svn__location_in_filter,
NULL, AP_FTYPE_CONTENT_SET);
ap_hook_fixups(dav_svn__proxy_request_fixup, NULL, NULL, APR_HOOK_MIDDLE);
+ /* translate_name hook is LAST so that it doesn't interfere with modules
+ * like mod_alias that are MIDDLE. */
+ ap_hook_translate_name(dav_svn__translate_name, NULL, NULL, APR_HOOK_LAST);
+ /* map_to_storage hook is LAST to avoid interferring with mod_http's
+ * handling of OPTIONS and TRACE. */
+ ap_hook_map_to_storage(dav_svn__map_to_storage, NULL, NULL, APR_HOOK_LAST);
}
Modified: subversion/branches/move-tracking-1/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/mod_dav_svn/repos.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/move-tracking-1/subversion/mod_dav_svn/repos.c Mon Aug 19 12:07:51 2013
@@ -53,6 +53,7 @@
#include "mod_dav_svn.h"
#include "svn_ra.h" /* for SVN_RA_CAPABILITY_* */
#include "svn_dirent_uri.h"
+
#include "private/svn_log.h"
#include "private/svn_fspath.h"
#include "private/svn_repos_private.h"
@@ -2408,21 +2409,12 @@ get_parent_path(const char *path,
svn_boolean_t is_urlpath,
apr_pool_t *pool)
{
- apr_size_t len;
- char *tmp = apr_pstrdup(pool, path);
-
- len = strlen(tmp);
-
- if (len > 0)
+ if (*path != '\0') /* not an empty string */
{
- /* Remove any trailing slash; else svn_path_dirname() asserts. */
- if (tmp[len-1] == '/')
- tmp[len-1] = '\0';
-
if (is_urlpath)
- return svn_urlpath__dirname(tmp, pool);
+ return svn_urlpath__dirname(path, pool);
else
- return svn_fspath__dirname(tmp, pool);
+ return svn_fspath__dirname(path, pool);
}
return path;
@@ -2458,7 +2450,9 @@ get_parent_resource(const dav_resource *
parent->versioned = 1;
parent->hooks = resource->hooks;
parent->pool = resource->pool;
- parent->uri = get_parent_path(resource->uri, TRUE, resource->pool);
+ parent->uri = get_parent_path(svn_urlpath__canonicalize(resource->uri,
+ resource->pool),
+ TRUE, resource->pool);
parent->info = parentinfo;
parentinfo->uri_path =
Modified: subversion/branches/move-tracking-1/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-1/subversion/mod_dav_svn/version.c?rev=1515380&r1=1515379&r2=1515380&view=diff
==============================================================================
--- subversion/branches/move-tracking-1/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/move-tracking-1/subversion/mod_dav_svn/version.c Mon Aug 19 12:07:51 2013
@@ -39,6 +39,7 @@
#include "svn_dav.h"
#include "svn_base64.h"
#include "svn_version.h"
+
#include "private/svn_repos_private.h"
#include "private/svn_subr_private.h"
#include "private/svn_dav_protocol.h"