You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/12/06 21:23:58 UTC
svn commit: r1418054 [2/3] - in /subversion/branches/in-repo-authz: ./
subversion/include/ subversion/include/private/ subversion/libsvn_client/
subversion/libsvn_ra_serf/ subversion/libsvn_subr/ subversion/libsvn_wc/
subversion/mod_dav_svn/ subversion...
Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.c?rev=1418054&r1=1418053&r2=1418054&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.c Thu Dec 6 20:23:54 2012
@@ -117,6 +117,7 @@ svn_wc__db_op_depth_for_upgrade(const ch
}
+/* Representation of a new base row for the NODES table */
typedef struct insert_base_baton_t {
/* common to all insertions into BASE */
svn_wc__db_status_t status;
@@ -175,6 +176,7 @@ typedef struct insert_base_baton_t {
} insert_base_baton_t;
+/* Representation of a new working row for the NODES table */
typedef struct insert_working_baton_t {
/* common to all insertions into WORKING (including NODE_DATA) */
svn_wc__db_status_t presence;
@@ -216,6 +218,7 @@ typedef struct insert_working_baton_t {
} insert_working_baton_t;
+/* Representation of a new row for the EXTERNALS table */
typedef struct insert_external_baton_t {
/* common to all insertions into EXTERNALS */
svn_kind_t kind;
@@ -383,7 +386,7 @@ wclock_owns_lock(svn_boolean_t *own_lock
svn_boolean_t exact,
apr_pool_t *scratch_pool);
-/* Baton for db_is_switched */
+/* Baton for passing args to db_is_switched(). */
struct db_is_switched_baton_t
{
svn_boolean_t *is_switched;
@@ -395,7 +398,8 @@ db_is_switched(void *baton,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
apr_pool_t *scratch_pool);
-
+
+
/* Return the absolute path, in local path style, of LOCAL_RELPATH
in WCROOT. */
static const char *
@@ -711,7 +715,9 @@ svn_wc__db_retract_parent_delete(svn_wc_
-/* */
+/* Insert the base row represented by (insert_base_baton_t *) BATON.
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
insert_base_node(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -886,6 +892,8 @@ insert_base_node(void *baton,
}
+/* Initialize the baton with appropriate "blank" values. This allows the
+ insertion function to leave certain columns null. */
static void
blank_iwb(insert_working_baton_t *piwb)
{
@@ -988,7 +996,9 @@ insert_incomplete_children(svn_sqlite__d
}
-/* */
+/* Insert the working row represented by (insert_working_baton_t *) BATON.
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
insert_working_node(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -1426,7 +1436,7 @@ does_node_exist(svn_boolean_t *exists,
return svn_error_trace(svn_sqlite__reset(stmt));
}
-/* baton for init_db */
+/* Baton for passing args to init_db(). */
struct init_db_baton
{
/* output values */
@@ -1440,9 +1450,13 @@ struct init_db_baton
svn_depth_t root_node_depth;
};
-/* Helper for create_db(). Initializes our wc.db schema */
+/* Helper for create_db(). Initializes our wc.db schema.
+ *
+ * Implements svn_sqlite__transaction_callback_t. */
static svn_error_t *
-init_db( void *baton, svn_sqlite__db_t *db, apr_pool_t *scratch_pool)
+init_db(void *baton,
+ svn_sqlite__db_t *db,
+ apr_pool_t *scratch_pool)
{
struct init_db_baton *idb = baton;
svn_sqlite__stmt_t *stmt;
@@ -2094,7 +2108,7 @@ svn_wc__db_base_add_not_present_node(svn
kind, svn_wc__db_status_not_present, conflict, work_items, scratch_pool);
}
-/* Baton for db_base_remove */
+/* Baton for passing args to db_base_remove(). */
struct base_remove_baton
{
svn_wc__db_t *db; /* For checking conflicts */
@@ -2104,7 +2118,9 @@ struct base_remove_baton
svn_skel_t *work_items;
};
-/* This implements svn_wc__db_txn_callback_t */
+/* The body of svn_wc__db_base_remove().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
db_base_remove(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -2123,7 +2139,7 @@ db_base_remove(void *baton,
SVN_ERR(svn_wc__db_base_get_info_internal(&status, &kind, NULL,
&repos_relpath, &repos_id,
NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
wcroot, local_relpath,
scratch_pool, scratch_pool));
@@ -2356,6 +2372,7 @@ svn_wc__db_base_get_info_internal(svn_wc
const char **target,
svn_wc__db_lock_t **lock,
svn_boolean_t *had_props,
+ apr_hash_t **props,
svn_boolean_t *update_root,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
@@ -2374,8 +2391,9 @@ svn_wc__db_base_get_info_internal(svn_wc
if (have_row)
{
- svn_kind_t node_kind = svn_sqlite__column_token(stmt, 3,
- kind_map);
+ svn_wc__db_status_t node_status = svn_sqlite__column_token(stmt, 2,
+ presence_map);
+ svn_kind_t node_kind = svn_sqlite__column_token(stmt, 3, kind_map);
if (kind)
{
@@ -2383,7 +2401,7 @@ svn_wc__db_base_get_info_internal(svn_wc
}
if (status)
{
- *status = svn_sqlite__column_token(stmt, 2, presence_map);
+ *status = node_status;
}
err = repos_location_from_columns(repos_id, revision, repos_relpath,
stmt, 0, 4, 1, result_pool);
@@ -2451,6 +2469,14 @@ svn_wc__db_base_get_info_internal(svn_wc
{
*had_props = SQLITE_PROPERTIES_AVAILABLE(stmt, 13);
}
+ if (props)
+ {
+ SVN_ERR(svn_sqlite__column_properties(props, stmt, 13,
+ result_pool, scratch_pool));
+ /* Column should be non-null if status is 'normal'. */
+ /* ### Except for a bug: see body of svn_wc__db_base_get_props(). */
+ assert(*props || node_status != svn_wc__db_status_normal);
+ }
if (update_root)
{
/* It's an update root iff it's a file external. */
@@ -2485,6 +2511,7 @@ svn_wc__db_base_get_info(svn_wc__db_stat
const char **target,
svn_wc__db_lock_t **lock,
svn_boolean_t *had_props,
+ apr_hash_t **props,
svn_boolean_t *update_root,
svn_wc__db_t *db,
const char *local_abspath,
@@ -2506,7 +2533,7 @@ svn_wc__db_base_get_info(svn_wc__db_stat
changed_rev, changed_date,
changed_author, depth,
checksum, target, lock,
- had_props, update_root,
+ had_props, props, update_root,
wcroot, local_relpath,
result_pool, scratch_pool));
SVN_ERR_ASSERT(repos_id != INVALID_REPOS_ID);
@@ -2756,6 +2783,7 @@ svn_wc__db_depth_get_info(svn_wc__db_sta
const svn_checksum_t **checksum,
const char **target,
svn_boolean_t *had_props,
+ apr_hash_t **props,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
int op_depth,
@@ -2774,8 +2802,9 @@ svn_wc__db_depth_get_info(svn_wc__db_sta
if (have_row)
{
- svn_kind_t node_kind = svn_sqlite__column_token(stmt, 3,
- kind_map);
+ svn_wc__db_status_t node_status = svn_sqlite__column_token(stmt, 2,
+ presence_map);
+ svn_kind_t node_kind = svn_sqlite__column_token(stmt, 3, kind_map);
if (kind)
{
@@ -2783,7 +2812,7 @@ svn_wc__db_depth_get_info(svn_wc__db_sta
}
if (status)
{
- *status = svn_sqlite__column_token(stmt, 2, presence_map);
+ *status = node_status;
if (op_depth > 0)
SVN_ERR(convert_to_working_status(status, *status));
@@ -2849,6 +2878,14 @@ svn_wc__db_depth_get_info(svn_wc__db_sta
{
*had_props = SQLITE_PROPERTIES_AVAILABLE(stmt, 13);
}
+ if (props)
+ {
+ SVN_ERR(svn_sqlite__column_properties(props, stmt, 13,
+ result_pool, scratch_pool));
+ /* Column should be non-null if status is 'normal' */
+ /* ### Except for a bug: see body of svn_wc__db_base_get_props(). */
+ assert(*props || node_status != svn_wc__db_status_normal);
+ }
}
else
{
@@ -2863,11 +2900,7 @@ svn_wc__db_depth_get_info(svn_wc__db_sta
}
-/* Helper for creating SQLite triggers, running the main transaction
- callback, and then dropping the triggers. It guarantees that the
- triggers will not survive the transaction. This could be used for
- any general prefix/postscript statements where the postscript
- *must* be executed if the transaction completes. */
+/* Baton for passing args to with_triggers(). */
struct with_triggers_baton_t {
int create_trigger;
int drop_trigger;
@@ -2875,7 +2908,13 @@ struct with_triggers_baton_t {
void *cb_baton;
};
-/* conforms to svn_wc__db_txn_callback_t */
+/* Helper for creating SQLite triggers, running the main transaction
+ callback, and then dropping the triggers. It guarantees that the
+ triggers will not survive the transaction. This could be used for
+ any general prefix/postscript statements where the postscript
+ *must* be executed if the transaction completes.
+
+ Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
with_triggers(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -2954,6 +2993,8 @@ with_finalization(svn_wc__db_wcroot_t *w
}
+/* Initialize the baton with appropriate "blank" values. This allows the
+ insertion function to leave certain columns null. */
static void
blank_ieb(insert_external_baton_t *ieb)
{
@@ -2966,6 +3007,9 @@ blank_ieb(insert_external_baton_t *ieb)
ieb->recorded_revision = SVN_INVALID_REVNUM;
}
+/* Insert the externals row represented by (insert_external_baton_t *) BATON.
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
insert_external_node(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -2988,7 +3032,7 @@ insert_external_node(void *baton,
/* And there must be no existing BASE node or it must be a file external */
err = svn_wc__db_base_get_info_internal(&status, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, &update_root,
+ NULL, NULL, NULL, NULL, &update_root,
wcroot, local_relpath,
scratch_pool, scratch_pool);
if (err)
@@ -3305,15 +3349,20 @@ svn_wc__db_external_add_dir(svn_wc__db_t
&ieb, scratch_pool));
}
-/* Baton for db_external_remove */
+/* Baton for passing args to db_external_remove(). */
struct external_remove_baton
{
const svn_skel_t *work_items;
};
+/* The body of svn_wc__db_external_remove().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
-db_external_remove(void *baton, svn_wc__db_wcroot_t *wcroot,
- const char *local_relpath, apr_pool_t *scratch_pool)
+db_external_remove(void *baton,
+ svn_wc__db_wcroot_t *wcroot,
+ const char *local_relpath,
+ apr_pool_t *scratch_pool)
{
svn_sqlite__stmt_t *stmt;
struct external_remove_baton *rb = baton;
@@ -3840,7 +3889,7 @@ get_info_for_copy(apr_int64_t *copyfrom_
copyfrom_relpath,
copyfrom_id, NULL, NULL,
NULL, NULL, NULL, NULL,
- NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
wcroot, local_relpath,
result_pool,
scratch_pool));
@@ -3861,15 +3910,44 @@ get_info_for_copy(apr_int64_t *copyfrom_
}
-/* Forward declarations for db_op_copy() to use.
-
- ### these are just to avoid churn. a future commit should shuffle the
- ### functions around. */
+/* Set *OP_DEPTH to the highest op depth of WCROOT:LOCAL_RELPATH. */
static svn_error_t *
op_depth_of(int *op_depth,
svn_wc__db_wcroot_t *wcroot,
- const char *local_relpath);
+ const char *local_relpath)
+{
+ svn_sqlite__stmt_t *stmt;
+ svn_boolean_t have_row;
+
+ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+ STMT_SELECT_NODE_INFO));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+ SVN_ERR_ASSERT(have_row);
+ *op_depth = svn_sqlite__column_int(stmt, 0);
+ SVN_ERR(svn_sqlite__reset(stmt));
+
+ return SVN_NO_ERROR;
+}
+
+
+/* Determine at which OP_DEPTH a copy of COPYFROM_REPOS_ID, COPYFROM_RELPATH at
+ revision COPYFROM_REVISION should be inserted as LOCAL_RELPATH. Do this
+ by checking if this would be a direct child of a copy of its parent
+ directory. If it is then set *OP_DEPTH to the op_depth of its parent.
+
+ If the node is not a direct copy at the same revision of the parent
+ *NP_OP_DEPTH will be set to the op_depth of the parent when a not-present
+ node should be inserted at this op_depth. This will be the case when the
+ parent already defined an incomplete child with the same name. Otherwise
+ *NP_OP_DEPTH will be set to -1.
+
+ If the parent node is not the parent of the to be copied node, then
+ *OP_DEPTH will be set to the proper op_depth for a new operation root.
+
+ Set *PARENT_OP_DEPTH to the op_depth of the parent.
+ */
static svn_error_t *
op_depth_for_copy(int *op_depth,
int *np_op_depth,
@@ -3879,7 +3957,86 @@ op_depth_for_copy(int *op_depth,
svn_revnum_t copyfrom_revision,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
- apr_pool_t *scratch_pool);
+ apr_pool_t *scratch_pool)
+{
+ const char *parent_relpath, *name;
+ svn_sqlite__stmt_t *stmt;
+ svn_boolean_t have_row;
+ int incomplete_op_depth = -1;
+ int min_op_depth = 1; /* Never touch BASE */
+
+ *op_depth = relpath_depth(local_relpath);
+ *np_op_depth = -1;
+
+ svn_relpath_split(&parent_relpath, &name, local_relpath, scratch_pool);
+ *parent_op_depth = relpath_depth(parent_relpath);
+
+ if (!copyfrom_relpath)
+ return SVN_NO_ERROR;
+
+ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+ STMT_SELECT_WORKING_NODE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+ if (have_row)
+ {
+ svn_wc__db_status_t status = svn_sqlite__column_token(stmt, 1,
+ presence_map);
+
+ min_op_depth = svn_sqlite__column_int(stmt, 0);
+ if (status == svn_wc__db_status_incomplete)
+ incomplete_op_depth = min_op_depth;
+ }
+ SVN_ERR(svn_sqlite__reset(stmt));
+
+ SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
+ STMT_SELECT_WORKING_NODE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, parent_relpath));
+ SVN_ERR(svn_sqlite__step(&have_row, stmt));
+ if (have_row)
+ {
+ svn_wc__db_status_t presence = svn_sqlite__column_token(stmt, 1,
+ presence_map);
+
+ *parent_op_depth = svn_sqlite__column_int(stmt, 0);
+ if (*parent_op_depth < min_op_depth)
+ {
+ /* We want to create a copy; not overwrite the lower layers */
+ SVN_ERR(svn_sqlite__reset(stmt));
+ return SVN_NO_ERROR;
+ }
+
+ /* You can only add children below a node that exists.
+ In WORKING that must be status added, which is represented
+ as presence normal */
+ SVN_ERR_ASSERT(presence == svn_wc__db_status_normal);
+
+ if ((incomplete_op_depth < 0)
+ || (incomplete_op_depth == *parent_op_depth))
+ {
+ apr_int64_t parent_copyfrom_repos_id
+ = svn_sqlite__column_int64(stmt, 10);
+ const char *parent_copyfrom_relpath
+ = svn_sqlite__column_text(stmt, 11, NULL);
+ svn_revnum_t parent_copyfrom_revision
+ = svn_sqlite__column_revnum(stmt, 12);
+
+ if (parent_copyfrom_repos_id == copyfrom_repos_id)
+ {
+ if (copyfrom_revision == parent_copyfrom_revision
+ && !strcmp(copyfrom_relpath,
+ svn_relpath_join(parent_copyfrom_relpath, name,
+ scratch_pool)))
+ *op_depth = *parent_op_depth;
+ else if (incomplete_op_depth > 0)
+ *np_op_depth = incomplete_op_depth;
+ }
+ }
+ }
+ SVN_ERR(svn_sqlite__reset(stmt));
+
+ return SVN_NO_ERROR;
+}
/* Like svn_wc__db_op_copy(), but with WCROOT+LOCAL_RELPATH
@@ -4129,7 +4286,7 @@ db_op_copy(svn_wc__db_wcroot_t *src_wcro
return SVN_NO_ERROR;
}
-/* Baton for op_copy_txn */
+/* Baton for passing args to op_copy_txn(). */
struct op_copy_baton
{
svn_wc__db_wcroot_t *src_wcroot;
@@ -4144,10 +4301,13 @@ struct op_copy_baton
const char *dst_op_root_relpath;
};
-/* Helper for svn_wc__db_op_copy.
- Implements svn_sqlite__transaction_callback_t */
+/* Helper for svn_wc__db_op_copy().
+ *
+ * Implements svn_sqlite__transaction_callback_t. */
static svn_error_t *
-op_copy_txn(void * baton, svn_sqlite__db_t *sdb, apr_pool_t *scratch_pool)
+op_copy_txn(void * baton,
+ svn_sqlite__db_t *sdb,
+ apr_pool_t *scratch_pool)
{
struct op_copy_baton *ocb = baton;
int move_op_depth;
@@ -4250,7 +4410,8 @@ db_op_copy_shadowed_layer(svn_wc__db_wcr
svn_error_t *err;
err = svn_wc__db_depth_get_info(&status, &kind, &node_revision,
&node_repos_relpath, &node_repos_id,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL,
src_wcroot, src_relpath, src_op_depth,
scratch_pool, scratch_pool);
@@ -4420,10 +4581,12 @@ db_op_copy_shadowed_layer(svn_wc__db_wcr
return SVN_NO_ERROR;
}
-/* Helper for svn_wc__db_op_copy_shadowed_layer.
- Implements svn_sqlite__transaction_callback_t */
+/* Helper for svn_wc__db_op_copy_shadowed_layer().
+ *
+ * Implements svn_sqlite__transaction_callback_t. */
static svn_error_t *
-op_copy_shadowed_layer_txn(void * baton, svn_sqlite__db_t *sdb,
+op_copy_shadowed_layer_txn(void *baton,
+ svn_sqlite__db_t *sdb,
apr_pool_t *scratch_pool)
{
struct op_copy_baton *ocb = baton;
@@ -4467,7 +4630,8 @@ op_copy_shadowed_layer_txn(void * baton,
/* Get some information from the parent */
SVN_ERR(svn_wc__db_depth_get_info(NULL, NULL, &revision, &repos_relpath,
&repos_id, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, ocb->src_wcroot,
+ NULL, NULL, NULL,
+ ocb->src_wcroot,
src_parent_relpath, src_op_depth,
scratch_pool, scratch_pool));
@@ -4533,27 +4697,6 @@ svn_wc__db_op_copy_shadowed_layer(svn_wc
}
-/* Set *OP_DEPTH to the highest op depth of WCROOT:LOCAL_RELPATH. */
-static svn_error_t *
-op_depth_of(int *op_depth,
- svn_wc__db_wcroot_t *wcroot,
- const char *local_relpath)
-{
- svn_sqlite__stmt_t *stmt;
- svn_boolean_t have_row;
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
- STMT_SELECT_NODE_INFO));
- SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- SVN_ERR_ASSERT(have_row);
- *op_depth = svn_sqlite__column_int(stmt, 0);
- SVN_ERR(svn_sqlite__reset(stmt));
-
- return SVN_NO_ERROR;
-}
-
-
/* If there are any server-excluded base nodes then the copy must fail
as it's not possible to commit such a copy.
Return an error if there are any server-excluded nodes. */
@@ -4586,114 +4729,6 @@ catch_copy_of_server_excluded(svn_wc__db
}
-/* Determine at which OP_DEPTH a copy of COPYFROM_REPOS_ID, COPYFROM_RELPATH at
- revision COPYFROM_REVISION should be inserted as LOCAL_RELPATH. Do this
- by checking if this would be a direct child of a copy of its parent
- directory. If it is then set *OP_DEPTH to the op_depth of its parent.
-
- If the node is not a direct copy at the same revision of the parent
- *NP_OP_DEPTH will be set to the op_depth of the parent when a not-present
- node should be inserted at this op_depth. This will be the case when the
- parent already defined an incomplete child with the same name. Otherwise
- *NP_OP_DEPTH will be set to -1.
-
- If the parent node is not the parent of the to be copied node, then
- *OP_DEPTH will be set to the proper op_depth for a new operation root.
-
- Set *PARENT_OP_DEPTH to the op_depth of the parent.
-
- */
-static svn_error_t *
-op_depth_for_copy(int *op_depth,
- int *np_op_depth,
- int *parent_op_depth,
- apr_int64_t copyfrom_repos_id,
- const char *copyfrom_relpath,
- svn_revnum_t copyfrom_revision,
- svn_wc__db_wcroot_t *wcroot,
- const char *local_relpath,
- apr_pool_t *scratch_pool)
-{
- const char *parent_relpath, *name;
- svn_sqlite__stmt_t *stmt;
- svn_boolean_t have_row;
- int incomplete_op_depth = -1;
- int min_op_depth = 1; /* Never touch BASE */
-
- *op_depth = relpath_depth(local_relpath);
- *np_op_depth = -1;
-
- svn_relpath_split(&parent_relpath, &name, local_relpath, scratch_pool);
- *parent_op_depth = relpath_depth(parent_relpath);
-
- if (!copyfrom_relpath)
- return SVN_NO_ERROR;
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
- STMT_SELECT_WORKING_NODE));
- SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, local_relpath));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- if (have_row)
- {
- svn_wc__db_status_t status = svn_sqlite__column_token(stmt, 1,
- presence_map);
-
- min_op_depth = svn_sqlite__column_int(stmt, 0);
- if (status == svn_wc__db_status_incomplete)
- incomplete_op_depth = min_op_depth;
- }
- SVN_ERR(svn_sqlite__reset(stmt));
-
- SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
- STMT_SELECT_WORKING_NODE));
- SVN_ERR(svn_sqlite__bindf(stmt, "is", wcroot->wc_id, parent_relpath));
- SVN_ERR(svn_sqlite__step(&have_row, stmt));
- if (have_row)
- {
- svn_wc__db_status_t presence = svn_sqlite__column_token(stmt, 1,
- presence_map);
-
- *parent_op_depth = svn_sqlite__column_int(stmt, 0);
- if (*parent_op_depth < min_op_depth)
- {
- /* We want to create a copy; not overwrite the lower layers */
- SVN_ERR(svn_sqlite__reset(stmt));
- return SVN_NO_ERROR;
- }
-
- /* You can only add children below a node that exists.
- In WORKING that must be status added, which is represented
- as presence normal */
- SVN_ERR_ASSERT(presence == svn_wc__db_status_normal);
-
- if ((incomplete_op_depth < 0)
- || (incomplete_op_depth == *parent_op_depth))
- {
- apr_int64_t parent_copyfrom_repos_id
- = svn_sqlite__column_int64(stmt, 10);
- const char *parent_copyfrom_relpath
- = svn_sqlite__column_text(stmt, 11, NULL);
- svn_revnum_t parent_copyfrom_revision
- = svn_sqlite__column_revnum(stmt, 12);
-
- if (parent_copyfrom_repos_id == copyfrom_repos_id)
- {
- if (copyfrom_revision == parent_copyfrom_revision
- && !strcmp(copyfrom_relpath,
- svn_relpath_join(parent_copyfrom_relpath, name,
- scratch_pool)))
- *op_depth = *parent_op_depth;
- else if (incomplete_op_depth > 0)
- *np_op_depth = incomplete_op_depth;
- }
- }
- }
- SVN_ERR(svn_sqlite__reset(stmt));
-
- return SVN_NO_ERROR;
-}
-
-
svn_error_t *
svn_wc__db_op_copy_dir(svn_wc__db_t *db,
const char *local_abspath,
@@ -5043,7 +5078,7 @@ svn_wc__db_op_add_symlink(svn_wc__db_t *
return SVN_NO_ERROR;
}
-/* Baton for db_record_fileinfo */
+/* Baton for passing args to db_record_fileinfo(). */
struct record_baton_t {
svn_filesize_t recorded_size;
apr_time_t recorded_time;
@@ -5102,16 +5137,6 @@ svn_wc__db_global_record_fileinfo(svn_wc
}
-struct set_props_baton_t
-{
- apr_hash_t *props;
- svn_boolean_t clear_recorded_info;
-
- const svn_skel_t *conflict;
- const svn_skel_t *work_items;
-};
-
-
/* Set the ACTUAL_NODE properties column for (WC_ID, LOCAL_RELPATH) to
* PROPS. */
static svn_error_t *
@@ -5145,11 +5170,27 @@ set_actual_props(apr_int64_t wc_id,
}
-/* Set the 'properties' column in the 'ACTUAL_NODE' table to BATON->props.
+/* Baton for passing args to set_props_txn(). */
+struct set_props_baton_t
+{
+ apr_hash_t *props;
+ svn_boolean_t clear_recorded_info;
+
+ const svn_skel_t *conflict;
+ const svn_skel_t *work_items;
+};
+
+
+/* The body of svn_wc__db_op_set_props().
+
+ Set the 'properties' column in the 'ACTUAL_NODE' table to BATON->props.
Create an entry in the ACTUAL table for the node if it does not yet
have one.
To specify no properties, BATON->props must be an empty hash, not NULL.
- BATON is of type 'struct set_props_baton_t'. */
+ BATON is of type 'struct set_props_baton_t'.
+
+ Implements svn_wc__db_txn_callback_t.
+*/
static svn_error_t *
set_props_txn(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -5460,7 +5501,9 @@ struct set_changelist_baton_t
};
-/* */
+/* The main part of svn_wc__db_op_set_changelist().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
set_changelist_txn(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -5518,7 +5561,9 @@ set_changelist_txn(void *baton,
}
-/* Implement work_callback_t. */
+/* Send notifications for svn_wc__db_op_set_changelist().
+ *
+ * Implements work_callback_t. */
static svn_error_t *
do_changelist_notify(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -5689,7 +5734,7 @@ svn_wc__db_op_mark_conflict(svn_wc__db_t
}
-/* Baton for db_op_mark_resolved */
+/* Baton for passing args to db_op_mark_resolved(). */
struct op_mark_resolved_baton
{
svn_boolean_t resolved_text;
@@ -5699,7 +5744,9 @@ struct op_mark_resolved_baton
svn_wc__db_t *db;
};
-/* Helper for svn_wc__db_op_mark_resolved */
+/* The body of svn_wc__db_op_mark_resolved().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
db_op_mark_resolved(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -5849,7 +5896,9 @@ clear_moved_to(const char *local_relpath
return SVN_NO_ERROR;
}
-/* This implements svn_wc__db_txn_callback_t */
+/* One of the two alternative bodies of svn_wc__db_op_revert().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
op_revert_txn(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -5966,7 +6015,9 @@ op_revert_txn(void *baton,
}
-/* This implements svn_wc__db_txn_callback_t */
+/* One of the two alternative bodies of svn_wc__db_op_revert().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
op_revert_recursive_txn(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -6126,6 +6177,7 @@ svn_wc__db_op_revert(svn_wc__db_t *db,
return SVN_NO_ERROR;
}
+/* Baton for passing args to revert_list_read(). */
struct revert_list_read_baton {
svn_boolean_t *reverted;
apr_array_header_t *marker_paths;
@@ -6135,6 +6187,9 @@ struct revert_list_read_baton {
svn_wc__db_t *db;
};
+/* The body of svn_wc__db_revert_list_read().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
revert_list_read(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -6244,11 +6299,15 @@ svn_wc__db_revert_list_read(svn_boolean_
}
+/* Baton for passing args to revert_list_read_copied_children(). */
struct revert_list_read_copied_children_baton {
const apr_array_header_t **children;
apr_pool_t *result_pool;
};
+/* The body of svn_wc__db_revert_list_read_copied_children().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
revert_list_read_copied_children(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -6387,7 +6446,7 @@ svn_wc__db_revert_list_done(svn_wc__db_t
return SVN_NO_ERROR;
}
-/* Baton for remove_node_txn */
+/* Baton for passing args to remove_node_txn(). */
struct remove_node_baton
{
svn_wc__db_t *db;
@@ -6403,7 +6462,9 @@ struct remove_node_baton
void *cancel_baton;
};
-/* Implements svn_wc__db_txn_callback_t for svn_wc__db_op_remove_node */
+/* The body of svn_wc__db_op_remove_node().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
remove_node_txn(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -6427,7 +6488,7 @@ remove_node_txn(void *baton,
SVN_ERR(svn_wc__db_base_get_info_internal(NULL, NULL, NULL,
&repos_relpath, &repos_id,
NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
wcroot, local_relpath,
scratch_pool, scratch_pool));
@@ -6700,7 +6761,7 @@ svn_wc__db_op_remove_node(svn_boolean_t
}
-/* Baton for db_op_set_base_depth */
+/* Baton for passing args to db_op_set_base_depth(). */
struct set_base_depth_baton_t
{
svn_depth_t depth;
@@ -8287,6 +8348,7 @@ svn_wc__db_read_pristine_info(svn_wc__db
const svn_checksum_t **checksum, /* files only */
const char **target, /* symlinks only */
svn_boolean_t *had_props,
+ apr_hash_t **props,
svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *result_pool,
@@ -8422,6 +8484,14 @@ svn_wc__db_read_pristine_info(svn_wc__db
{
*had_props = SQLITE_PROPERTIES_AVAILABLE(stmt, 14);
}
+ if (props)
+ {
+ SVN_ERR(svn_sqlite__column_properties(props, stmt, 14,
+ result_pool, scratch_pool));
+ /* Column should be non-null if status is 'normal' */
+ /* ### Except for a bug: see body of svn_wc__db_base_get_props(). */
+ assert(*props || raw_status != svn_wc__db_status_normal);
+ }
return svn_error_trace(
svn_error_compose_create(err,
@@ -8609,7 +8679,7 @@ read_url_txn(void *baton,
&repos_id,
NULL, NULL, NULL,
NULL, NULL, NULL,
- NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
wcroot,
base_del_relpath,
scratch_pool,
@@ -8863,7 +8933,7 @@ svn_wc__db_read_props_streamily(svn_wc__
}
-/* Baton for db_read_props */
+/* Baton for passing args to db_read_props(). */
struct db_read_props_baton_t
{
apr_hash_t *props;
@@ -8871,7 +8941,9 @@ struct db_read_props_baton_t
};
-/* Helper for svn_wc__db_read_props(). Implements svn_wc__db_txn_callback_t */
+/* Helper for svn_wc__db_read_props().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
db_read_props(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -9096,14 +9168,16 @@ svn_wc__db_prop_retrieve_recursive(apr_h
return svn_error_trace(svn_sqlite__reset(stmt));
}
-/* Baton for db_read_cached_iprops */
+/* Baton for passing args to db_read_cached_iprops(). */
struct read_cached_iprops_baton_t
{
apr_array_header_t *iprops;
apr_pool_t *result_pool;
};
-/* Implements svn_wc__db_txn_callback_t for svn_wc__db_read_cached_iprops */
+/* The body of svn_wc__db_read_cached_iprops().
+ *
+ * (Not called in a txn, but implements svn_wc__db_txn_callback_t anyway.) */
static svn_error_t *
db_read_cached_iprops(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -9190,7 +9264,7 @@ filter_unwanted_props(apr_hash_t *prop_h
return;
}
-/* Baton for db_read_inherited_props */
+/* Baton for passing args to db_read_inherited_props(). */
struct read_inherited_props_baton_t
{
apr_array_header_t *iprops;
@@ -9198,7 +9272,9 @@ struct read_inherited_props_baton_t
apr_pool_t *result_pool;
};
-/* Implements svn_wc__db_txn_callback_t for svn_wc__db_read_inherited_props */
+/* The body of svn_wc__db_read_inherited_props().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
db_read_inherited_props(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -9353,7 +9429,7 @@ svn_wc__db_read_inherited_props(apr_arra
return SVN_NO_ERROR;
}
-/* Baton for get_children_with_cached_iprops */
+/* Baton for passing args to get_children_with_cached_iprops(). */
struct get_children_with_cached_baton_t
{
svn_depth_t depth;
@@ -9361,8 +9437,9 @@ struct get_children_with_cached_baton_t
apr_pool_t *result_pool;
};
-/* Implements svn_wc__db_txn_callback_t for
- svn_wc__db_get_children_with_cached_iprops. */
+/* The body of svn_wc__db_get_children_with_cached_iprops().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
get_children_with_cached_iprops(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -9453,7 +9530,7 @@ get_children_with_cached_iprops(void *ba
SVN_ERR(svn_wc__db_base_get_info_internal(NULL, &child_kind, NULL,
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
- NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
wcroot, child_relpath,
scratch_pool,
scratch_pool));
@@ -9524,7 +9601,7 @@ svn_wc__db_read_children_of_working_node
result_pool, scratch_pool);
}
-/* Baton for check_replace_txn */
+/* Baton for passing args to check_replace_txn(). */
struct check_replace_baton
{
svn_boolean_t *is_replace_root;
@@ -9532,8 +9609,9 @@ struct check_replace_baton
svn_boolean_t is_replace;
};
-/* Helper for svn_wc__db_node_check_replace. Implements
- svn_wc__db_txn_callback_t */
+/* Helper for svn_wc__db_node_check_replace().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
check_replace_txn(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -9855,7 +9933,7 @@ svn_wc__db_global_relocate(svn_wc__db_t
SVN_ERR(svn_wc__db_base_get_info_internal(NULL, NULL, NULL, NULL,
&rb.old_repos_id,
NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
wcroot, local_dir_relpath,
scratch_pool, scratch_pool));
}
@@ -9919,7 +9997,7 @@ determine_repos_info(apr_int64_t *repos_
SVN_ERR(svn_wc__db_base_get_info_internal(NULL, NULL, NULL,
&repos_parent_relpath, repos_id,
NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
wcroot, local_parent_relpath,
scratch_pool, scratch_pool));
@@ -9978,6 +10056,7 @@ descendant_commit(svn_wc__db_wcroot_t *w
return SVN_NO_ERROR;
}
+/* Baton for passing args to commit_node(). */
struct commit_baton_t {
svn_revnum_t new_revision;
svn_revnum_t changed_rev;
@@ -9992,8 +10071,9 @@ struct commit_baton_t {
const svn_skel_t *work_items;
};
-
-/* */
+/* The body of svn_wc__db_global_commit().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
commit_node(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -10420,7 +10500,7 @@ db_op_set_rev_repos_relpath_iprops(svn_w
return SVN_NO_ERROR;
}
-/* The main body of bump_revisions_post_update.
+/* The main body of bump_revisions_post_update().
*
* Tweak the information for LOCAL_RELPATH in WCROOT. If NEW_REPOS_RELPATH is
* non-NULL update the entry to the new url specified by NEW_REPOS_RELPATH,
@@ -10469,7 +10549,7 @@ bump_node_revision(svn_wc__db_wcroot_t *
SVN_ERR(svn_wc__db_base_get_info_internal(&status, &db_kind, &revision,
&repos_relpath, &repos_id,
NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, &update_root,
+ NULL, NULL, NULL, NULL, &update_root,
wcroot, local_relpath,
scratch_pool, scratch_pool));
@@ -10575,7 +10655,7 @@ bump_node_revision(svn_wc__db_wcroot_t *
return SVN_NO_ERROR;
}
-/* Baton for bump_revisions_post_update */
+/* Baton for passing args to bump_revisions_post_update(). */
struct bump_revisions_baton_t
{
svn_depth_t depth;
@@ -10588,6 +10668,9 @@ struct bump_revisions_baton_t
svn_wc__db_t *db;
};
+/* Helper for svn_wc__db_op_bump_revisions_post_update().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
bump_revisions_post_update(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -10602,7 +10685,7 @@ bump_revisions_post_update(void *baton,
err = svn_wc__db_base_get_info_internal(&status, &kind, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL,
wcroot, local_relpath,
scratch_pool, scratch_pool);
if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
@@ -10682,6 +10765,9 @@ svn_wc__db_op_bump_revisions_post_update
return SVN_NO_ERROR;
}
+/* The body of svn_wc__db_lock_add(). BATON is the lock.
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
lock_add_txn(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -10696,7 +10782,7 @@ lock_add_txn(void *baton,
SVN_ERR(svn_wc__db_base_get_info_internal(NULL, NULL, NULL,
&repos_relpath, &repos_id,
NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
wcroot, local_relpath,
scratch_pool, scratch_pool));
@@ -10745,6 +10831,9 @@ svn_wc__db_lock_add(svn_wc__db_t *db,
}
+/* The body of svn_wc__db_lock_remove(). BATON is unused.
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
lock_remove_txn(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -10758,7 +10847,7 @@ lock_remove_txn(void *baton,
SVN_ERR(svn_wc__db_base_get_info_internal(NULL, NULL, NULL,
&repos_relpath, &repos_id,
NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
wcroot, local_relpath,
scratch_pool, scratch_pool));
@@ -10818,7 +10907,7 @@ svn_wc__db_scan_base_repos(const char **
SVN_ERR(svn_wc__db_base_get_info_internal(NULL, NULL, NULL,
repos_relpath, &repos_id,
NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
wcroot, local_relpath,
result_pool, scratch_pool));
SVN_ERR(fetch_repos_info(repos_root_url, repos_uuid, wcroot->sdb,
@@ -10935,6 +11024,7 @@ get_moved_from_info(svn_wc__db_status_t
return SVN_NO_ERROR;
}
+/* Baton for passing args to scan_addition_txn(). */
struct scan_addition_baton_t
{
svn_wc__db_status_t *status;
@@ -10950,6 +11040,9 @@ struct scan_addition_baton_t
apr_pool_t *result_pool;
};
+/* The body of scan_addition().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
scan_addition_txn(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -11174,7 +11267,7 @@ scan_addition_txn(void *baton,
SVN_ERR(svn_wc__db_base_get_info_internal(NULL, NULL, NULL,
&base_relpath, sab->repos_id,
NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
wcroot, op_root_relpath,
scratch_pool, scratch_pool));
@@ -11335,6 +11428,8 @@ svn_wc__db_scan_addition(svn_wc__db_stat
return SVN_NO_ERROR;
}
+/* ###
+ */
static svn_error_t *
follow_moved_to(apr_array_header_t **moved_tos,
int op_depth,
@@ -11563,6 +11658,9 @@ get_moved_to(struct scan_deletion_baton_
}
+/* The body of svn_wc__db_scan_deletion_internal().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
scan_deletion_txn(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -12142,7 +12240,7 @@ svn_wc__db_wq_add(svn_wc__db_t *db,
scratch_pool));
}
-/* Baton for wq_fetch_next */
+/* Baton for passing args to wq_fetch_next(). */
struct wq_fetch_next_baton_t
{
apr_uint64_t id;
@@ -12150,6 +12248,9 @@ struct wq_fetch_next_baton_t
apr_pool_t *result_pool;
};
+/* The body of svn_wc__db_wq_fetch_next().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
wq_fetch_next(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -12469,7 +12570,7 @@ svn_wc__db_read_conflict_victims(const a
return SVN_NO_ERROR;
}
-/* Baton for get_conflict_marker_files */
+/* Baton for passing args to get_conflict_marker_files(). */
struct marker_files_baton
{
apr_pool_t *result_pool;
@@ -12477,10 +12578,14 @@ struct marker_files_baton
svn_wc__db_t *db;
};
-/* Locked implementation for svn_wc__db_get_conflict_marker_files */
+/* The body of svn_wc__db_get_conflict_marker_files().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
-get_conflict_marker_files(void *baton, svn_wc__db_wcroot_t *wcroot,
- const char *local_relpath, apr_pool_t *scratch_pool)
+get_conflict_marker_files(void *baton,
+ svn_wc__db_wcroot_t *wcroot,
+ const char *local_relpath,
+ apr_pool_t *scratch_pool)
{
svn_sqlite__stmt_t *stmt;
svn_boolean_t have_row;
@@ -12804,7 +12909,11 @@ svn_wc__db_is_wcroot(svn_boolean_t *is_w
return SVN_NO_ERROR;
}
-/* This implements svn_wc__db_txn_callback_t for svn_wc__db_is_switched() */
+/* Find a node's kind and whether it is switched, putting the outputs in
+ * BATON->kind and BATON->is_switched. Mainly used by
+ * svn_wc__db_is_switched().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
db_is_switched(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -12854,7 +12963,8 @@ db_is_switched(void *baton,
SVN_ERR(svn_wc__db_base_get_info_internal(NULL, NULL, NULL,
&parent_repos_relpath,
&parent_repos_id, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL,
wcroot, parent_local_relpath,
scratch_pool, scratch_pool));
@@ -12943,7 +13053,7 @@ svn_wc__db_temp_wcroot_tempdir(const cha
}
-/* Baton for wclock_obtain_cb() */
+/* Baton for passing args to wclock_obtain_cb(). */
struct wclock_obtain_baton_t
{
int levels_to_lock;
@@ -12968,7 +13078,9 @@ wclock_steal(svn_wc__db_wcroot_t *wcroot
}
-/* svn_sqlite__transaction_callback_t for svn_wc__db_wclock_obtain() */
+/* The body of svn_wc__db_wclock_obtain().
+ *
+ * Implements svn_sqlite__transaction_callback_t. */
static svn_error_t *
wclock_obtain_cb(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -13185,7 +13297,9 @@ svn_wc__db_wclock_obtain(svn_wc__db_t *d
}
-/* Implements svn_wc__db_txn_callback_t. */
+/* The body of svn_wc__db_wclocked(). Output is through (svn_boolean_t *)BATON.
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
is_wclocked(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -13404,7 +13518,9 @@ svn_wc__db_wclock_owns_lock(svn_boolean_
return SVN_NO_ERROR;
}
-/* Lock helper for svn_wc__db_temp_op_end_directory_update */
+/* The body of svn_wc__db_temp_op_end_directory_update().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
end_directory_update(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -13416,7 +13532,7 @@ end_directory_update(void *baton,
SVN_ERR(svn_wc__db_base_get_info_internal(&base_status, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL, NULL,
wcroot, local_relpath,
scratch_pool, scratch_pool));
@@ -13458,6 +13574,7 @@ svn_wc__db_temp_op_end_directory_update(
}
+/* Baton for passing args to start_directory_update_txn(). */
struct start_directory_update_baton_t
{
svn_revnum_t new_rev;
@@ -13465,6 +13582,9 @@ struct start_directory_update_baton_t
};
+/* The body of svn_wc__db_temp_op_start_directory_update().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
start_directory_update_txn(void *baton,
svn_wc__db_wcroot_t *wcroot,
@@ -13522,7 +13642,7 @@ svn_wc__db_temp_op_start_directory_updat
}
-/* Baton for make_copy_txn */
+/* Baton for passing args to make_copy_txn(). */
struct make_copy_baton_t
{
int op_depth;
@@ -13531,7 +13651,7 @@ struct make_copy_baton_t
};
-/* Transaction callback for svn_wc__db_temp_op_make_copy. This is
+/* The body of svn_wc__db_temp_op_make_copy(). This is
used by the update editor when deleting a base node tree would be a
tree-conflict because there are changes to subtrees. This function
inserts a copy of the base node tree below any existing working
@@ -13563,6 +13683,8 @@ struct make_copy_baton_t
A/F/E normal norm base-del
A/X normal norm
A/X/Y incomplete incomplete
+
+ Implements svn_wc__db_txn_callback_t.
*/
static svn_error_t *
make_copy_txn(void *baton,
@@ -13908,7 +14030,7 @@ has_switched_subtrees(svn_boolean_t *is_
SVN_ERR(svn_wc__db_base_get_info_internal(NULL, NULL, NULL,
&repos_relpath, &repos_id,
NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
wcroot, local_relpath,
scratch_pool, scratch_pool));
@@ -14196,6 +14318,7 @@ svn_wc__db_has_local_mods(svn_boolean_t
}
+/* Baton for passing args to revision_status_txn(). */
struct revision_status_baton_t
{
svn_revnum_t *min_revision;
@@ -14214,6 +14337,9 @@ struct revision_status_baton_t
};
+/* The body of svn_wc__db_revision_status().
+ *
+ * Implements svn_wc__db_txn_callback_t. */
static svn_error_t *
revision_status_txn(void *baton,
svn_wc__db_wcroot_t *wcroot,
Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.h?rev=1418054&r1=1418053&r2=1418054&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db.h Thu Dec 6 20:23:54 2012
@@ -74,7 +74,7 @@ extern "C" {
The pool that DB is allocated within (the "state" pool) is only used
for a few, limited allocations to track each of the working copy roots
that the DB is asked to operate upon. The memory usage on this pool
- os O(# wcroots), which should normally be one or a few. Custom clients
+ is O(# wcroots), which should normally be one or a few. Custom clients
which hold open structures over a significant period of time should
pay particular attention to the number of roots touched, and the
resulting impact on memory consumption (which should still be minimal).
@@ -213,7 +213,7 @@ typedef struct svn_wc__db_lock_t {
/*
- @defgroup svn_wc__db_admin General administractive functions
+ @defgroup svn_wc__db_admin General administrative functions
@{
*/
@@ -729,6 +729,7 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
LOCK NULL
HAD_PROPS FALSE
+ PROPS NULL
UPDATE_ROOT FALSE
@@ -744,6 +745,11 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
If TARGET is requested, and the node is NOT a symlink, then it will
be set to NULL.
+ *PROPS maps "const char *" names to "const svn_string_t *" values. If
+ the base node is capable of having properties but has none, set
+ *PROPS to an empty hash. If its status is such that it cannot have
+ properties, set *PROPS to NULL.
+
If UPDATE_ROOT is requested, set it to TRUE if the node should only
be updated when it is the root of an update (e.g. file externals).
@@ -765,6 +771,7 @@ svn_wc__db_base_get_info(svn_wc__db_stat
const char **target,
svn_wc__db_lock_t **lock,
svn_boolean_t *had_props,
+ apr_hash_t **props,
svn_boolean_t *update_root,
svn_wc__db_t *db,
const char *local_abspath,
@@ -1150,7 +1157,7 @@ svn_wc__db_external_remove(svn_wc__db_t
When KIND is requested then the value will be set to the kind of external.
- If DEFININING_ABSPATH is requested, then the value will be set to the
+ If DEFINING_ABSPATH is requested, then the value will be set to the
absolute path of the directory which originally defined the external.
(The path with the svn:externals property)
@@ -1284,7 +1291,7 @@ svn_wc__db_op_copy(svn_wc__db_t *db,
* of SRC_ABSPATH (so SRC_ABSPATH must be an op_root) to dst_abspaths
* parents layer.
*
- * This operation is recursive. It copies all the descandants at the lower
+ * This operation is recursive. It copies all the descendants at the lower
* layer and adds base-deleted nodes on dst_abspath layer to mark these nodes
* properly deleted.
*
@@ -1818,7 +1825,7 @@ svn_wc__db_revert_list_done(svn_wc__db_t
### the TEXT_MOD may become an enumerated value at some point to
### indicate different states of knowledge about text modifications.
### for example, an "svn edit" command in the future might set a
- ### flag indicating adminstratively-defined modification. and/or we
+ ### flag indicating administratively-defined modification. and/or we
### might have a status indicating that we saw it was modified while
### performing a filesystem traversal.
@@ -1975,6 +1982,11 @@ struct svn_wc__db_walker_info_t {
calling svn_wc__db_read_info().
(All other information (like original_*) can be obtained via other apis).
+
+ *PROPS maps "const char *" names to "const svn_string_t *" values. If
+ the pristine node is capable of having properties but has none, set
+ *PROPS to an empty hash. If its status is such that it cannot have
+ properties, set *PROPS to NULL.
*/
svn_error_t *
svn_wc__db_read_pristine_info(svn_wc__db_status_t *status,
@@ -1986,6 +1998,7 @@ svn_wc__db_read_pristine_info(svn_wc__db
const svn_checksum_t **checksum, /* files only */
const char **target, /* symlinks only */
svn_boolean_t *had_props,
+ apr_hash_t **props,
svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *result_pool,
@@ -2013,7 +2026,7 @@ svn_wc__db_read_node_install_info(const
apr_pool_t *scratch_pool);
/* Return in *NODES a hash mapping name->struct svn_wc__db_walker_info_t for
- the children of DIR_ABSPATH. "name" is the child's name relatve to
+ the children of DIR_ABSPATH. "name" is the child's name relative to
DIR_ABSPATH, not an absolute path. */
svn_error_t *
svn_wc__db_read_children_walker_info(apr_hash_t **nodes,
@@ -2171,7 +2184,7 @@ svn_wc__db_prop_retrieve_recursive(apr_h
Return every path that refers to a child of the working node at
LOCAL_ABSPATH. Do not include a path just because it was a child of a
deleted directory that existed at LOCAL_ABSPATH if that directory is now
- sheduled to be replaced by the working node at LOCAL_ABSPATH.
+ scheduled to be replaced by the working node at LOCAL_ABSPATH.
Allocate *CHILDREN in RESULT_POOL and do temporary allocations in
SCRATCH_POOL.
@@ -2378,7 +2391,7 @@ svn_wc__db_global_relocate(svn_wc__db_t
CHANGED_REVISION is the new 'last changed' revision. If the node is
modified its value is equivalent to NEW_REVISION, but in case of a
- decendant of a copy/move it can be an older revision.
+ descendant of a copy/move it can be an older revision.
CHANGED_DATE is the (server-side) date of CHANGED_REVISION. It may be 0 if
the revprop is missing on the revision.
@@ -3121,7 +3134,7 @@ svn_wc__db_get_not_present_descendants(c
* Only nodes with op_depth zero and presence 'normal' or 'incomplete'
* are considered, so that added, deleted or excluded nodes do not affect
* the result. If COMMITTED is TRUE, set *MIN_REVISION and *MAX_REVISION
- * to the lowest and highest comitted (i.e. "last changed") revision numbers,
+ * to the lowest and highest committed (i.e. "last changed") revision numbers,
* respectively.
*
* Indicate in *IS_SPARSE_CHECKOUT whether any of the nodes within
@@ -3156,7 +3169,7 @@ svn_wc__db_revision_status(svn_revnum_t
* Only nodes with op_depth zero and presence 'normal' or 'incomplete'
* are considered, so that added, deleted or excluded nodes do not affect
* the result. If COMMITTED is TRUE, set *MIN_REVISION and *MAX_REVISION
- * to the lowest and highest comitted (i.e. "last changed") revision numbers,
+ * to the lowest and highest committed (i.e. "last changed") revision numbers,
* respectively. Use SCRATCH_POOL for temporary allocations.
*
* Either of MIN_REVISION and MAX_REVISION may be passed as NULL if
Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_private.h?rev=1418054&r1=1418053&r2=1418054&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_private.h Thu Dec 6 20:23:54 2012
@@ -96,7 +96,7 @@ typedef struct svn_wc__db_wcroot_t {
Typically just one or two locks maximum. */
apr_array_header_t *owned_locks;
- /* Map a working copy diretory to a cached adm_access baton.
+ /* Map a working copy directory to a cached adm_access baton.
const char *local_abspath -> svn_wc_adm_access_t *adm_access */
apr_hash_t *access_cache;
@@ -254,6 +254,7 @@ svn_wc__db_base_get_info_internal(svn_wc
const char **target,
svn_wc__db_lock_t **lock,
svn_boolean_t *had_props,
+ apr_hash_t **props,
svn_boolean_t *update_root,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
@@ -287,6 +288,7 @@ svn_wc__db_depth_get_info(svn_wc__db_sta
const svn_checksum_t **checksum,
const char **target,
svn_boolean_t *had_props,
+ apr_hash_t **props,
svn_wc__db_wcroot_t *wcroot,
const char *local_relpath,
int op_depth,
Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_update_move.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_update_move.c?rev=1418054&r1=1418053&r2=1418054&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_update_move.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/wc_db_update_move.c Thu Dec 6 20:23:54 2012
@@ -194,21 +194,28 @@ check_shadowed_node(svn_boolean_t *is_sh
return SVN_NO_ERROR;
}
-/* Update text and prop contents of the working file at DST_RELPATH
- * in the working copy at WCROOT, from OLD_VERSION to NEW_VERSION,
- * based on pristine contents identified by MOVE_SRC_CHECKSUM and
- * MOVE_DST_CHECKSUM. MOVE_DST_REPOS_RELPATH is the repository path
- * the node at DST_RELPATH would be committed to.
- * Use working copy database DB.
+/* Update text and prop contents of the working file at LOCAL_RELPATH.
+ *
+ * The term 'old' refers to the pre-update state, which is the state of
+ * (some layer of) LOCAL_RELPATH while this function runs; and 'new'
+ * refers to the post-update state, as found at the (base layer of) the
+ * move source path while this function runs.
+ *
+ * LOCAL_RELPATH is a file in the working copy at WCROOT in DB, and
+ * REPOS_RELPATH is the repository path it would be committed to.
+ *
+ * Merge the changes between OLD_VERSION to NEW_VERSION, whose pristine
+ * contents are identified by OLD_CHECKSUM and NEW_CHECKSUM.
+ *
* Use NOTIFY_FUNC and NOTIFY_BATON for notifications.
* Add any required work items to *WORK_ITEMS, allocated in RESULT_POOL.
* Use SCRATCH_POOL for temporary allocations. */
static svn_error_t *
update_working_file(svn_skel_t **work_items,
- const char *dst_relpath,
- const char *move_dst_repos_relpath,
- const svn_checksum_t *move_src_checksum,
- const svn_checksum_t *move_dst_checksum,
+ const char *local_relpath,
+ const char *repos_relpath,
+ const svn_checksum_t *old_checksum,
+ const svn_checksum_t *new_checksum,
svn_wc_conflict_version_t *old_version,
svn_wc_conflict_version_t *new_version,
svn_wc__db_wcroot_t *wcroot,
@@ -218,11 +225,11 @@ update_working_file(svn_skel_t **work_it
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
- const char *moved_to_abspath = svn_dirent_join(wcroot->abspath,
- dst_relpath,
+ const char *local_abspath = svn_dirent_join(wcroot->abspath,
+ local_relpath,
scratch_pool);
- const char *pre_update_pristine_abspath;
- const char *post_update_pristine_abspath;
+ const char *old_pristine_abspath;
+ const char *new_pristine_abspath;
svn_skel_t *conflict_skel;
enum svn_wc_merge_outcome_t merge_outcome;
svn_wc_notify_state_t content_state;
@@ -234,20 +241,20 @@ update_working_file(svn_skel_t **work_it
* text as the merge-left version, and the current content of the
* moved-here working file as the merge-right version.
*/
- SVN_ERR(svn_wc__db_pristine_get_path(&pre_update_pristine_abspath,
+ SVN_ERR(svn_wc__db_pristine_get_path(&old_pristine_abspath,
db, wcroot->abspath,
- move_dst_checksum,
+ old_checksum,
scratch_pool, scratch_pool));
- SVN_ERR(svn_wc__db_pristine_get_path(&post_update_pristine_abspath,
+ SVN_ERR(svn_wc__db_pristine_get_path(&new_pristine_abspath,
db, wcroot->abspath,
- move_src_checksum,
+ new_checksum,
scratch_pool, scratch_pool));
SVN_ERR(svn_wc__internal_merge(work_items, &conflict_skel,
&merge_outcome, db,
- pre_update_pristine_abspath,
- post_update_pristine_abspath,
- moved_to_abspath,
- moved_to_abspath,
+ old_pristine_abspath,
+ new_pristine_abspath,
+ local_abspath,
+ local_abspath,
NULL, NULL, NULL, /* diff labels */
NULL, /* actual props */
FALSE, /* dry-run */
@@ -266,14 +273,14 @@ update_working_file(svn_skel_t **work_it
{
original_version = svn_wc_conflict_version_dup(old_version,
scratch_pool);
- original_version->path_in_repos = move_dst_repos_relpath;
+ original_version->path_in_repos = repos_relpath;
original_version->node_kind = svn_node_file;
SVN_ERR(svn_wc__conflict_skel_set_op_update(conflict_skel,
original_version,
scratch_pool,
scratch_pool));
SVN_ERR(svn_wc__conflict_create_markers(&work_item, db,
- moved_to_abspath,
+ local_abspath,
conflict_skel,
scratch_pool,
scratch_pool));
@@ -286,7 +293,7 @@ update_working_file(svn_skel_t **work_it
svn_boolean_t is_locally_modified;
SVN_ERR(svn_wc__internal_file_modified_p(&is_locally_modified,
- db, moved_to_abspath,
+ db, local_abspath,
FALSE /* exact_comparison */,
scratch_pool));
if (is_locally_modified)
@@ -295,7 +302,7 @@ update_working_file(svn_skel_t **work_it
content_state = svn_wc_notify_state_changed;
}
- notify = svn_wc_create_notify(moved_to_abspath,
+ notify = svn_wc_create_notify(local_abspath,
svn_wc_notify_update_update,
scratch_pool);
notify->kind = svn_node_file;
@@ -309,13 +316,16 @@ update_working_file(svn_skel_t **work_it
}
+/* Edit the file found at the move destination, which is initially at
+ * the old state. Merge the changes into the "working"/"actual" file.
+ */
static svn_error_t *
tc_editor_alter_file(void *baton,
const char *dst_relpath,
svn_revnum_t expected_move_dst_revision,
- apr_hash_t *props,
- const svn_checksum_t *move_src_checksum,
- svn_stream_t *post_update_contents,
+ apr_hash_t *new_props,
+ const svn_checksum_t *new_checksum,
+ svn_stream_t *new_contents,
apr_pool_t *scratch_pool)
{
struct tc_editor_baton *b = baton;
@@ -328,7 +338,8 @@ tc_editor_alter_file(void *baton,
SVN_ERR(svn_wc__db_depth_get_info(NULL, &move_dst_kind, &move_dst_revision,
&move_dst_repos_relpath, NULL, NULL, NULL,
NULL, NULL, &move_dst_checksum, NULL,
- NULL, b->wcroot, dst_relpath,
+ NULL, NULL,
+ b->wcroot, dst_relpath,
relpath_depth(b->move_root_dst_relpath),
scratch_pool, scratch_pool));
SVN_ERR_ASSERT(move_dst_revision == expected_move_dst_revision);
@@ -337,7 +348,7 @@ tc_editor_alter_file(void *baton,
/* ### TODO update revision etc. in NODES table */
/* Update file and prop contents if the update has changed them. */
- if (!svn_checksum_match(move_src_checksum, move_dst_checksum)
+ if (!svn_checksum_match(new_checksum, move_dst_checksum)
/* ### || props have changed */)
{
svn_boolean_t is_shadowed;
@@ -354,7 +365,7 @@ tc_editor_alter_file(void *baton,
else
SVN_ERR(update_working_file(b->work_items, dst_relpath,
move_dst_repos_relpath,
- move_src_checksum, move_dst_checksum,
+ move_dst_checksum, new_checksum,
b->old_version, b->new_version,
b->wcroot, b->db,
b->notify_func, b->notify_baton,
@@ -560,7 +571,7 @@ get_tc_info(svn_wc_operation_t *operatio
/* Construct new_version from BASE info. */
SVN_ERR(svn_wc__db_base_get_info(NULL, &kind, &revision,
&repos_relpath, &repos_root_url,
- &repos_uuid, NULL, NULL, NULL,
+ &repos_uuid, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
db, src_abspath, result_pool,
scratch_pool));
@@ -597,35 +608,35 @@ update_moved_away_file(svn_editor_t *tc_
apr_pool_t *scratch_pool)
{
svn_kind_t kind;
- svn_stream_t *post_update_contents;
- const svn_checksum_t *move_src_checksum;
+ svn_stream_t *new_contents;
+ const svn_checksum_t *new_checksum;
/* Read post-update contents from the updated moved-away file and tell
* the editor to merge them into the moved-here file. */
SVN_ERR(svn_wc__db_read_pristine_info(NULL, &kind, NULL, NULL, NULL, NULL,
- &move_src_checksum, NULL, NULL, db,
- svn_dirent_join(wcroot->abspath,
- src_relpath,
- scratch_pool),
+ &new_checksum, NULL, NULL, NULL,
+ db, svn_dirent_join(wcroot->abspath,
+ src_relpath,
+ scratch_pool),
scratch_pool, scratch_pool));
- SVN_ERR(svn_wc__db_pristine_read(&post_update_contents, NULL, db,
- wcroot->abspath, move_src_checksum,
+ SVN_ERR(svn_wc__db_pristine_read(&new_contents, NULL, db,
+ wcroot->abspath, new_checksum,
scratch_pool, scratch_pool));
-
+
if (add)
/* FIXME: editor API violation: missing svn_editor_alter_directory. */
SVN_ERR(svn_editor_add_file(tc_editor, dst_relpath,
- move_src_checksum, post_update_contents,
+ new_checksum, new_contents,
apr_hash_make(scratch_pool), /* ### TODO props */
move_root_dst_revision));
else
SVN_ERR(svn_editor_alter_file(tc_editor, dst_relpath,
move_root_dst_revision,
NULL, /* ### TODO props */
- move_src_checksum,
- post_update_contents));
+ new_checksum,
+ new_contents));
- SVN_ERR(svn_stream_close(post_update_contents));
+ SVN_ERR(svn_stream_close(new_contents));
return SVN_NO_ERROR;
}
Modified: subversion/branches/in-repo-authz/subversion/libsvn_wc/workqueue.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/libsvn_wc/workqueue.c?rev=1418054&r1=1418053&r2=1418054&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/libsvn_wc/workqueue.c (original)
+++ subversion/branches/in-repo-authz/subversion/libsvn_wc/workqueue.c Thu Dec 6 20:23:54 2012
@@ -148,7 +148,7 @@ run_base_remove(svn_wc__db_t *db,
¬_present_rev, NULL,
NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL,
+ NULL, NULL, NULL,
db, local_abspath,
scratch_pool, scratch_pool));
}
Modified: subversion/branches/in-repo-authz/subversion/mod_dav_svn/dav_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/mod_dav_svn/dav_svn.h?rev=1418054&r1=1418053&r2=1418054&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/branches/in-repo-authz/subversion/mod_dav_svn/dav_svn.h Thu Dec 6 20:23:54 2012
@@ -52,6 +52,12 @@ extern "C" {
/* a pool-key for the shared dav_svn_root used by autoversioning */
#define DAV_SVN__AUTOVERSIONING_ACTIVITY "svn-autoversioning-activity"
+/* Option values for SVNAllowBulkUpdates */
+typedef enum dav_svn__bulk_upd_conf {
+ CONF_BULKUPD_ON,
+ CONF_BULKUPD_OFF,
+ CONF_BULKUPD_FORCE
+} dav_svn__bulk_upd_conf;
/* dav_svn_repos
*
@@ -110,7 +116,7 @@ typedef struct dav_svn_repos {
svn_boolean_t autoversioning;
/* Whether bulk updates are allowed for this repository. */
- svn_boolean_t bulk_updates;
+ dav_svn__bulk_upd_conf bulk_updates;
/* Whether HTTP protocol version 2 is allowed to be used. */
svn_boolean_t v2_protocol;
@@ -302,7 +308,7 @@ const char *dav_svn__get_fs_parent_path(
svn_boolean_t dav_svn__get_autoversioning_flag(request_rec *r);
/* for the repository referred to by this request, are bulk updates allowed? */
-svn_boolean_t dav_svn__get_bulk_updates_flag(request_rec *r);
+dav_svn__bulk_upd_conf dav_svn__get_bulk_updates_flag(request_rec *r);
/* for the repository referred to by this request, are subrequests active? */
svn_boolean_t dav_svn__get_pathauthz_flag(request_rec *r);
Modified: subversion/branches/in-repo-authz/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/mod_dav_svn/mod_dav_svn.c?rev=1418054&r1=1418053&r2=1418054&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/in-repo-authz/subversion/mod_dav_svn/mod_dav_svn.c Thu Dec 6 20:23:54 2012
@@ -93,7 +93,7 @@ typedef struct dir_conf_t {
const char *xslt_uri; /* XSL transform URI */
const char *fs_parent_path; /* path to parent of SVN FS'es */
enum conf_flag autoversioning; /* whether autoversioning is active */
- enum conf_flag bulk_updates; /* whether bulk updates are allowed */
+ dav_svn__bulk_upd_conf bulk_updates; /* whether bulk updates are allowed */
enum conf_flag v2_protocol; /* whether HTTP v2 is advertised */
enum path_authz_conf path_authz_method; /* how GET subrequests are handled */
enum conf_flag list_parentpath; /* whether to allow GET of parentpath */
@@ -213,7 +213,7 @@ create_dir_config(apr_pool_t *p, char *d
<Location /blah> directive. So we treat it as a urlpath. */
if (dir)
conf->root_dir = svn_urlpath__canonicalize(dir, p);
- conf->bulk_updates = CONF_FLAG_ON;
+ conf->bulk_updates = CONF_BULKUPD_ON;
conf->v2_protocol = CONF_FLAG_ON;
conf->hooks_env = NULL;
@@ -357,14 +357,26 @@ SVNAutoversioning_cmd(cmd_parms *cmd, vo
static const char *
-SVNAllowBulkUpdates_cmd(cmd_parms *cmd, void *config, int arg)
+SVNAllowBulkUpdates_cmd(cmd_parms *cmd, void *config, const char *arg1)
{
dir_conf_t *conf = config;
- if (arg)
- conf->bulk_updates = CONF_FLAG_ON;
+ if (apr_strnatcasecmp("on", arg1) == 0)
+ {
+ conf->bulk_updates = CONF_BULKUPD_ON;
+ }
+ else if (apr_strnatcasecmp("off", arg1) == 0)
+ {
+ conf->bulk_updates = CONF_BULKUPD_OFF;
+ }
+ else if (apr_strnatcasecmp("force", arg1) == 0)
+ {
+ conf->bulk_updates = CONF_BULKUPD_FORCE;
+ }
else
- conf->bulk_updates = CONF_FLAG_OFF;
+ {
+ return "Unrecognized value for SVNAllowBulkUpdates directive";
+ }
return NULL;
}
@@ -793,13 +805,13 @@ dav_svn__get_autoversioning_flag(request
}
-svn_boolean_t
+dav_svn__bulk_upd_conf
dav_svn__get_bulk_updates_flag(request_rec *r)
{
dir_conf_t *conf;
conf = ap_get_module_config(r->per_dir_config, &dav_svn_module);
- return conf->bulk_updates == CONF_FLAG_ON;
+ return conf->bulk_updates;
}
@@ -1144,11 +1156,12 @@ static const command_rec cmds[] =
"activities database(s) should be stored"),
/* per directory/location */
- AP_INIT_FLAG("SVNAllowBulkUpdates", SVNAllowBulkUpdates_cmd, NULL,
- ACCESS_CONF|RSRC_CONF,
- "enables support for bulk update-style requests (as opposed to "
- "only skeletal reports that require additional per-file "
- "downloads."),
+ AP_INIT_TAKE1("SVNAllowBulkUpdates", SVNAllowBulkUpdates_cmd, NULL,
+ ACCESS_CONF|RSRC_CONF,
+ "enables support for bulk update-style requests (On, default), "
+ "as opposed to only skeletal reports that require additional "
+ "per-file downloads (Off). Use Force to always use bulk update "
+ "responses, regardless of what the client requested."),
/* per directory/location */
AP_INIT_FLAG("SVNAdvertiseV2Protocol", SVNAdvertiseV2Protocol_cmd, NULL,
Modified: subversion/branches/in-repo-authz/subversion/mod_dav_svn/reports/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/mod_dav_svn/reports/update.c?rev=1418054&r1=1418053&r2=1418054&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/branches/in-repo-authz/subversion/mod_dav_svn/reports/update.c Thu Dec 6 20:23:54 2012
@@ -1016,11 +1016,17 @@ dav_svn__update_report(const dav_resourc
SVN_DAV_ERROR_TAG);
}
- /* If server configuration permits bulk updates (a report with props
- and textdeltas inline, rather than placeholder tags that tell the
- client to do further fetches), look to see if client requested as
- much. */
- if (repos->bulk_updates)
+ /* SVNAllowBulkUpdates On: server configuration permits bulk updates (a report
+ with props and textdeltas inline, rather than placeholder tags that tell
+ the client to do further fetches), look to see if client requested as
+ much.
+
+ SVNAllowBulkUpdates Force: always use bulk updates, no matter what the
+ client requested.
+
+ SVNAllowBulkUpdates Off: no bulk updates allowed, force skelta mode.
+ */
+ if (repos->bulk_updates == CONF_BULKUPD_ON)
{
apr_xml_attr *this_attr;
@@ -1035,6 +1041,11 @@ dav_svn__update_report(const dav_resourc
}
}
}
+ else if (repos->bulk_updates == CONF_BULKUPD_FORCE)
+ {
+ uc.send_all = TRUE;
+ uc.include_props = TRUE;
+ }
/* Ask the repository about its youngest revision (which we'll need
for some input validation later). */
Modified: subversion/branches/in-repo-authz/subversion/tests/cmdline/merge_automatic_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/cmdline/merge_automatic_tests.py?rev=1418054&r1=1418053&r2=1418054&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/cmdline/merge_automatic_tests.py (original)
+++ subversion/branches/in-repo-authz/subversion/tests/cmdline/merge_automatic_tests.py Thu Dec 6 20:23:54 2012
@@ -762,10 +762,11 @@ def cherry3_fwd(sbox):
def subtree_to_and_fro(sbox):
"reintegrate considers source subtree mergeinfo"
-# A (--o-o-o-o---------x
-# ( \ \ /
-# ( \ \ /
-# B ( o--o------s--
+ # A (-----o-o-o-o------------x
+ # ( \ \ /
+ # ( \ \ /
+ # A_COPY ( o---------o--s--o--
+ # 2 3 4 5 6 7 8 9
# Some paths we'll care about.
A_COPY_gamma_path = sbox.ospath('A_COPY/D/gamma')
@@ -777,7 +778,7 @@ def subtree_to_and_fro(sbox):
wc_dir = sbox.wc_dir
# Setup a simple 'trunk & branch': Copy ^/A to ^/A_COPY in r2 and then
- # make a few edits under A in r3-6:
+ # make a few edits under A in r3-6 (edits r3, r4, r6 are under subtree 'D'):
wc_disk, wc_status = set_up_branch(sbox)
# r7 - Edit a file on the branch.
Modified: subversion/branches/in-repo-authz/subversion/tests/cmdline/prop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/in-repo-authz/subversion/tests/cmdline/prop_tests.py?rev=1418054&r1=1418053&r2=1418054&view=diff
==============================================================================
--- subversion/branches/in-repo-authz/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/branches/in-repo-authz/subversion/tests/cmdline/prop_tests.py Thu Dec 6 20:23:54 2012
@@ -2535,11 +2535,11 @@ def inheritable_ignores(sbox):
sbox.simple_propset('svn:ignore', '*.foo', 'A/B/E')
sbox.simple_commit()
- # Some directories and files that should be added because they don't
- # match any applicable ignores.
- X_dir_path = os.path.join(wc_dir, 'ADD-ME-DIR-X')
- Y_dir_path = os.path.join(wc_dir, 'A', 'ADD-ME-DIR-Y.doo')
- Z_dir_path = os.path.join(wc_dir, 'A', 'D', 'G', 'ADD-ME-DIR-Z.doo')
+ # Some directories and files that should always be added because they
+ # don't match any applicable ignore patterns.
+ X_dir_path = sbox.ospath('ADD-ME-DIR-X')
+ Y_dir_path = sbox.ospath('A/ADD-ME-DIR-Y.doo')
+ Z_dir_path = sbox.ospath('A/D/G/ADD-ME-DIR-Z.doo')
os.mkdir(X_dir_path)
os.mkdir(Y_dir_path)
os.mkdir(Z_dir_path)
@@ -2547,11 +2547,11 @@ def inheritable_ignores(sbox):
# Some directories and files that should be ignored when adding
# because they match an ignore pattern (unless of course they are
# the direct target of an add, which we always add).
- boo_dir_path = os.path.join(wc_dir, 'IGNORE-ME-DIR.boo')
- goo_dir_path = os.path.join(wc_dir, 'IGNORE-ME-DIR.boo', 'IGNORE-ME-DIR.goo')
- doo_dir_path = os.path.join(wc_dir, 'A', 'B', 'IGNORE-ME-DIR.doo')
- moo_dir_path = os.path.join(wc_dir, 'A', 'D', 'IGNORE-ME-DIR.moo')
- foo_dir_path = os.path.join(wc_dir, 'A', 'B', 'E', 'IGNORE-ME-DIR.foo')
+ boo_dir_path = sbox.ospath('IGNORE-ME-DIR.boo')
+ goo_dir_path = sbox.ospath('IGNORE-ME-DIR.boo/IGNORE-ME-DIR.goo')
+ doo_dir_path = sbox.ospath('A/B/IGNORE-ME-DIR.doo')
+ moo_dir_path = sbox.ospath('A/D/IGNORE-ME-DIR.moo')
+ foo_dir_path = sbox.ospath('A/B/E/IGNORE-ME-DIR.foo')
os.mkdir(boo_dir_path)
os.mkdir(goo_dir_path)
os.mkdir(doo_dir_path)
@@ -2650,8 +2650,8 @@ def inheritable_ignores(sbox):
'--config-dir', config_dir)
os.chdir(saved_wd)
- # Now revert and try the add with the --no-ignore flag, only the
- # svn:global-ignores should be enforced.
+ # Now revert and try the add with the --no-ignore flag, nothing should
+ # be ignored.
svntest.actions.run_and_verify_svn(None, None, [], 'revert', wc_dir, '-R')
saved_wd = os.getcwd()
os.chdir(sbox.wc_dir)
@@ -2665,10 +2665,20 @@ def inheritable_ignores(sbox):
'IGNORE-ME-DIR.goo') + '\n',
'A ' + os.path.join('A', 'B', 'E', 'IGNORE-ME-DIR.foo') + '\n',
'A ' + os.path.join('A', 'B', 'E', 'ignore-me-file.foo') + '\n',
- 'A ' + os.path.join('A', 'D', 'G', 'ignore-me-file.goo') + '\n'])
- svntest.actions.run_and_verify_svn("Adds in spite of ignores", expected,
- [], 'add', '.', '--force','--no-ignore',
- '--config-dir', config_dir)
+ 'A ' + os.path.join('A', 'D', 'G', 'ignore-me-file.goo') + '\n',
+
+ 'A ' + os.path.join('A', 'B', 'E', 'ignore-me-file.doo') + '\n',
+ 'A ' + os.path.join('A', 'B', 'IGNORE-ME-DIR.doo') + '\n',
+ 'A ' + os.path.join('A', 'B', 'IGNORE-ME-DIR.doo',
+ 'ignore-me-file.doo') + '\n',
+ 'A ' + os.path.join('A', 'B', 'IGNORE-ME-DIR.doo',
+ 'ignore-me-file.roo') + '\n',
+ 'A ' + os.path.join('A', 'D', 'IGNORE-ME-DIR.moo') + '\n',
+ 'A ' + os.path.join('A', 'D', 'ignore-me-file.moo') + '\n'])
+ svntest.actions.run_and_verify_svn("Files ignored with --no-ignore",
+ expected, [], 'add', '.', '--force',
+ '--no-ignore', '--config-dir',
+ config_dir)
def almost_known_prop_names(sbox):
"propset with svn: prefix but unknown name"