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 2012/11/02 01:57:12 UTC
svn commit: r1404846 [3/4] - in /subversion/branches/ev2-export: ./
subversion/include/ subversion/include/private/ subversion/libsvn_client/
subversion/libsvn_delta/ subversion/libsvn_fs_fs/ subversion/libsvn_ra/
subversion/libsvn_ra_serf/ subversion/...
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.c Fri Nov 2 00:57:09 2012
@@ -109,25 +109,6 @@
#define SQLITE_PROPERTIES_AVAILABLE(stmt, i) \
(svn_sqlite__column_bytes(stmt, i) > 2)
-/* Calculates the depth of the relpath below "" */
-APR_INLINE static int
-relpath_depth(const char *relpath)
-{
- int n = 1;
- if (*relpath == '\0')
- return 0;
-
- do
- {
- if (*relpath == '/')
- n++;
- }
- while (*(++relpath));
-
- return n;
-}
-
-
int
svn_wc__db_op_depth_for_upgrade(const char *local_relpath)
{
@@ -343,26 +324,6 @@ db_read_pristine_props(apr_hash_t **prop
apr_pool_t *scratch_pool);
static svn_error_t *
-base_get_info(svn_wc__db_status_t *status,
- svn_kind_t *kind,
- svn_revnum_t *revision,
- const char **repos_relpath,
- apr_int64_t *repos_id,
- svn_revnum_t *changed_rev,
- apr_time_t *changed_date,
- const char **changed_author,
- svn_depth_t *depth,
- const svn_checksum_t **checksum,
- const char **target,
- svn_wc__db_lock_t **lock,
- svn_boolean_t *had_props,
- svn_boolean_t *update_root,
- svn_wc__db_wcroot_t *wcroot,
- const char *local_relpath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-static svn_error_t *
read_info(svn_wc__db_status_t *status,
svn_kind_t *kind,
svn_revnum_t *revision,
@@ -410,16 +371,6 @@ scan_addition(svn_wc__db_status_t *statu
apr_pool_t *scratch_pool);
static svn_error_t *
-scan_deletion(const char **base_del_relpath,
- const char **moved_to_relpath,
- const char **work_del_relpath,
- const char **moved_to_op_root_relpath,
- svn_wc__db_wcroot_t *wcroot,
- const char *local_relpath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
-
-static svn_error_t *
convert_to_working_status(svn_wc__db_status_t *working_status,
svn_wc__db_status_t status);
@@ -2116,11 +2067,12 @@ db_base_remove(void *baton,
svn_kind_t kind;
svn_boolean_t keep_working;
- SVN_ERR(base_get_info(&status, &kind, NULL, &repos_relpath, &repos_id,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL,
- wcroot, local_relpath,
- scratch_pool, scratch_pool));
+ 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,
+ wcroot, local_relpath,
+ scratch_pool, scratch_pool));
/* ### This function should be turned into a helper of this function,
as this is the only valid caller */
@@ -2337,27 +2289,25 @@ svn_wc__db_base_remove(svn_wc__db_t *db,
}
-/* Like svn_wc__db_base_get_info(), but taking WCROOT+LOCAL_RELPATH instead of
- DB+LOCAL_ABSPATH and outputting REPOS_ID instead of URL+UUID. */
-static svn_error_t *
-base_get_info(svn_wc__db_status_t *status,
- svn_kind_t *kind,
- svn_revnum_t *revision,
- const char **repos_relpath,
- apr_int64_t *repos_id,
- svn_revnum_t *changed_rev,
- apr_time_t *changed_date,
- const char **changed_author,
- svn_depth_t *depth,
- const svn_checksum_t **checksum,
- const char **target,
- svn_wc__db_lock_t **lock,
- svn_boolean_t *had_props,
- svn_boolean_t *update_root,
- svn_wc__db_wcroot_t *wcroot,
- const char *local_relpath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+svn_error_t *
+svn_wc__db_base_get_info_internal(svn_wc__db_status_t *status,
+ svn_kind_t *kind,
+ svn_revnum_t *revision,
+ const char **repos_relpath,
+ apr_int64_t *repos_id,
+ svn_revnum_t *changed_rev,
+ apr_time_t *changed_date,
+ const char **changed_author,
+ svn_depth_t *depth,
+ const svn_checksum_t **checksum,
+ const char **target,
+ svn_wc__db_lock_t **lock,
+ svn_boolean_t *had_props,
+ svn_boolean_t *update_root,
+ svn_wc__db_wcroot_t *wcroot,
+ const char *local_relpath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
svn_sqlite__stmt_t *stmt;
svn_boolean_t have_row;
@@ -2497,11 +2447,14 @@ svn_wc__db_base_get_info(svn_wc__db_stat
local_abspath, scratch_pool, scratch_pool));
VERIFY_USABLE_WCROOT(wcroot);
- SVN_ERR(base_get_info(status, kind, revision, repos_relpath, &repos_id,
- changed_rev, changed_date, changed_author, depth,
- checksum, target, lock, had_props,
- update_root,
- wcroot, local_relpath, result_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_base_get_info_internal(status, kind, revision,
+ repos_relpath, &repos_id,
+ changed_rev, changed_date,
+ changed_author, depth,
+ checksum, target, lock,
+ had_props, update_root,
+ wcroot, local_relpath,
+ result_pool, scratch_pool));
SVN_ERR_ASSERT(repos_id != INVALID_REPOS_ID);
SVN_ERR(fetch_repos_info(repos_root_url, repos_uuid,
wcroot->sdb, repos_id, result_pool));
@@ -2961,9 +2914,11 @@ insert_external_node(void *baton,
wcroot->sdb, scratch_pool));
/* And there must be no existing BASE node or it must be a file external */
- err = base_get_info(&status, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, &update_root,
- wcroot, local_relpath, scratch_pool, scratch_pool);
+ err = svn_wc__db_base_get_info_internal(&status, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, &update_root,
+ wcroot, local_relpath,
+ scratch_pool, scratch_pool);
if (err)
{
if (err->apr_err != SVN_ERR_WC_PATH_NOT_FOUND)
@@ -3784,9 +3739,10 @@ get_info_for_copy(apr_int64_t *copyfrom_
{
const char *base_del_relpath, *work_del_relpath;
- SVN_ERR(scan_deletion(&base_del_relpath, NULL, &work_del_relpath,
- NULL, wcroot, local_relpath, scratch_pool,
- scratch_pool));
+ SVN_ERR(svn_wc__db_scan_deletion_internal(&base_del_relpath, NULL,
+ &work_del_relpath,
+ NULL, wcroot, local_relpath,
+ scratch_pool, scratch_pool));
if (work_del_relpath)
{
const char *op_root_relpath;
@@ -3808,12 +3764,14 @@ get_info_for_copy(apr_int64_t *copyfrom_
}
else if (base_del_relpath)
{
- SVN_ERR(base_get_info(NULL, NULL, copyfrom_rev, copyfrom_relpath,
- copyfrom_id,
- NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- wcroot, local_relpath,
- result_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_base_get_info_internal(NULL, NULL, copyfrom_rev,
+ copyfrom_relpath,
+ copyfrom_id, NULL, NULL,
+ NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL,
+ wcroot, local_relpath,
+ result_pool,
+ scratch_pool));
}
else
SVN_ERR_MALFUNCTION();
@@ -6392,11 +6350,12 @@ remove_node_txn(void *baton,
/* Need info for not_present node? */
if (SVN_IS_VALID_REVNUM(rnb->not_present_rev))
- SVN_ERR(base_get_info(NULL, NULL, NULL, &repos_relpath, &repos_id,
- NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- wcroot, local_relpath,
- scratch_pool, scratch_pool));
+ 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,
+ wcroot, local_relpath,
+ scratch_pool, scratch_pool));
if (rnb->destroy_wc
&& (!rnb->destroy_changes || *local_relpath == '\0'))
@@ -8561,17 +8520,25 @@ read_url_txn(void *baton,
const char *base_del_relpath;
const char *work_del_relpath;
- SVN_ERR(scan_deletion(&base_del_relpath, NULL, &work_del_relpath,
- NULL, wcroot, local_relpath,
- scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_scan_deletion_internal(&base_del_relpath, NULL,
+ &work_del_relpath,
+ NULL, wcroot,
+ local_relpath,
+ scratch_pool,
+ scratch_pool));
if (base_del_relpath)
{
- SVN_ERR(base_get_info(NULL, NULL, NULL, &repos_relpath,
- &repos_id, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- wcroot, base_del_relpath,
- scratch_pool, scratch_pool));
+ 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,
+ wcroot,
+ base_del_relpath,
+ scratch_pool,
+ scratch_pool));
repos_relpath = svn_relpath_join(
repos_relpath,
@@ -9543,9 +9510,12 @@ svn_wc__db_global_relocate(svn_wc__db_t
if (status == svn_wc__db_status_deleted)
{
const char *work_del_relpath;
- SVN_ERR(scan_deletion(NULL, NULL, &work_del_relpath, NULL,
- wcroot, local_dir_relpath,
- scratch_pool, scratch_pool));
+
+ SVN_ERR(svn_wc__db_scan_deletion_internal(NULL, NULL,
+ &work_del_relpath, NULL,
+ wcroot, local_dir_relpath,
+ scratch_pool,
+ scratch_pool));
if (work_del_relpath)
{
/* Deleted within a copy/move */
@@ -9565,11 +9535,12 @@ svn_wc__db_global_relocate(svn_wc__db_t
scratch_pool, scratch_pool));
}
else
- SVN_ERR(base_get_info(NULL, NULL, NULL, NULL, &rb.old_repos_id,
- NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- wcroot, local_dir_relpath,
- scratch_pool, scratch_pool));
+ 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,
+ wcroot, local_dir_relpath,
+ scratch_pool, scratch_pool));
}
SVN_ERR(fetch_repos_info(NULL, &rb.repos_uuid,
@@ -9628,11 +9599,12 @@ determine_repos_info(apr_int64_t *repos_
svn_relpath_split(&local_parent_relpath, &name, local_relpath, scratch_pool);
/* The REPOS_ID will be the same (### until we support mixed-repos) */
- SVN_ERR(base_get_info(NULL, NULL, NULL, &repos_parent_relpath, repos_id,
- NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- wcroot, local_parent_relpath,
- scratch_pool, scratch_pool));
+ 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,
+ wcroot, local_parent_relpath,
+ scratch_pool, scratch_pool));
*repos_relpath = svn_relpath_join(repos_parent_relpath, name, result_pool);
@@ -10167,11 +10139,12 @@ bump_node_revision(svn_wc__db_wcroot_t *
if (apr_hash_get(exclude_relpaths, local_relpath, APR_HASH_KEY_STRING))
return SVN_NO_ERROR;
- SVN_ERR(base_get_info(&status, &db_kind, &revision, &repos_relpath,
- &repos_id, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, &update_root,
- wcroot, local_relpath,
- scratch_pool, scratch_pool));
+ 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,
+ wcroot, local_relpath,
+ scratch_pool, scratch_pool));
/* Skip file externals */
if (update_root
@@ -10300,9 +10273,11 @@ bump_revisions_post_update(void *baton,
svn_error_t *err;
apr_int64_t new_repos_id = INVALID_REPOS_ID;
- err = base_get_info(&status, &kind, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- wcroot, local_relpath, scratch_pool, scratch_pool);
+ err = svn_wc__db_base_get_info_internal(&status, &kind, 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)
{
svn_error_clear(err);
@@ -10391,11 +10366,12 @@ lock_add_txn(void *baton,
const char *repos_relpath;
apr_int64_t repos_id;
- SVN_ERR(base_get_info(NULL, NULL, NULL, &repos_relpath, &repos_id,
- NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- wcroot, local_relpath,
- scratch_pool, scratch_pool));
+ 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,
+ wcroot, local_relpath,
+ scratch_pool, scratch_pool));
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb, STMT_INSERT_LOCK));
SVN_ERR(svn_sqlite__bindf(stmt, "iss",
@@ -10452,11 +10428,12 @@ lock_remove_txn(void *baton,
apr_int64_t repos_id;
svn_sqlite__stmt_t *stmt;
- SVN_ERR(base_get_info(NULL, NULL, NULL, &repos_relpath, &repos_id,
- NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- wcroot, local_relpath,
- scratch_pool, scratch_pool));
+ 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,
+ wcroot, local_relpath,
+ scratch_pool, scratch_pool));
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_DELETE_LOCK));
@@ -10511,10 +10488,12 @@ svn_wc__db_scan_base_repos(const char **
local_abspath, scratch_pool, scratch_pool));
VERIFY_USABLE_WCROOT(wcroot);
- SVN_ERR(base_get_info(NULL, NULL, NULL, repos_relpath, &repos_id,
- NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- wcroot, local_relpath, result_pool, scratch_pool));
+ 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,
+ wcroot, local_relpath,
+ result_pool, scratch_pool));
SVN_ERR(fetch_repos_info(repos_root_url, repos_uuid, wcroot->sdb,
repos_id, result_pool));
@@ -10865,11 +10844,12 @@ scan_addition_txn(void *baton,
{
const char *base_relpath;
- SVN_ERR(base_get_info(NULL, NULL, NULL, &base_relpath, sab->repos_id,
- NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL,
- wcroot, op_root_relpath,
- scratch_pool, scratch_pool));
+ 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,
+ wcroot, op_root_relpath,
+ scratch_pool, scratch_pool));
if (sab->repos_relpath)
*sab->repos_relpath = svn_relpath_join(base_relpath, build_relpath,
@@ -11409,17 +11389,15 @@ scan_deletion_txn(void *baton,
}
-/* Like svn_wc__db_scan_deletion(), but with WCROOT+LOCAL_RELPATH instead of
- DB+LOCAL_ABSPATH, and outputting relpaths instead of abspaths. */
-static svn_error_t *
-scan_deletion(const char **base_del_relpath,
- const char **moved_to_relpath,
- const char **work_del_relpath,
- const char **moved_to_op_root_relpath,
- svn_wc__db_wcroot_t *wcroot,
- const char *local_relpath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+svn_error_t *
+svn_wc__db_scan_deletion_internal(const char **base_del_relpath,
+ const char **moved_to_relpath,
+ const char **work_del_relpath,
+ const char **moved_to_op_root_relpath,
+ svn_wc__db_wcroot_t *wcroot,
+ const char *local_relpath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
struct scan_deletion_baton_t sd_baton;
@@ -11456,9 +11434,12 @@ svn_wc__db_scan_deletion(const char **ba
local_abspath, scratch_pool, scratch_pool));
VERIFY_USABLE_WCROOT(wcroot);
- SVN_ERR(scan_deletion(&base_del_relpath, &moved_to_relpath,
- &work_del_relpath, &moved_to_op_root_relpath, wcroot,
- local_relpath, scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_scan_deletion_internal(&base_del_relpath,
+ &moved_to_relpath,
+ &work_del_relpath,
+ &moved_to_op_root_relpath, wcroot,
+ local_relpath, scratch_pool,
+ scratch_pool));
if (base_del_abspath)
{
@@ -12286,14 +12267,28 @@ svn_wc__db_read_conflict(svn_skel_t **co
{
svn_wc__db_wcroot_t *wcroot;
const char *local_relpath;
- svn_sqlite__stmt_t *stmt;
- svn_boolean_t have_row;
/* The parent should be a working copy directory. */
SVN_ERR(svn_wc__db_wcroot_parse_local_abspath(&wcroot, &local_relpath, db,
local_abspath, scratch_pool, scratch_pool));
VERIFY_USABLE_WCROOT(wcroot);
+ return svn_error_trace(svn_wc__db_read_conflict_internal(conflict, wcroot,
+ local_relpath,
+ result_pool,
+ scratch_pool));
+}
+
+svn_error_t *
+svn_wc__db_read_conflict_internal(svn_skel_t **conflict,
+ svn_wc__db_wcroot_t *wcroot,
+ const char *local_relpath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ svn_sqlite__stmt_t *stmt;
+ svn_boolean_t have_row;
+
/* Check if we have a conflict in ACTUAL */
SVN_ERR(svn_sqlite__get_statement(&stmt, wcroot->sdb,
STMT_SELECT_ACTUAL_NODE));
@@ -12980,9 +12975,11 @@ end_directory_update(void *baton,
svn_sqlite__stmt_t *stmt;
svn_wc__db_status_t base_status;
- SVN_ERR(base_get_info(&base_status, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL,
- wcroot, local_relpath, scratch_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_base_get_info_internal(&base_status, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
+ NULL, NULL, NULL, NULL, NULL,
+ wcroot, local_relpath,
+ scratch_pool, scratch_pool));
if (base_status == svn_wc__db_status_normal)
return SVN_NO_ERROR;
@@ -13455,10 +13452,12 @@ has_switched_subtrees(svn_boolean_t *is_
*is_switched = FALSE;
- SVN_ERR(base_get_info(NULL, NULL, NULL, &repos_relpath, &repos_id, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- wcroot, local_relpath,
- scratch_pool, scratch_pool));
+ 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,
+ wcroot, local_relpath,
+ scratch_pool, scratch_pool));
/* First do the cheap check where we only need info on the origin itself */
if (trail_url != NULL)
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db.h Fri Nov 2 00:57:09 2012
@@ -3181,6 +3181,21 @@ svn_wc__db_follow_moved_to(apr_array_hea
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/* Update a moved-away tree conflict victim at VICTIM_ABSPATH with changes
+ * brought in by the update operation which flagged the tree conflict.
+ * Set *WORK_ITEMS to a list of work items, allocated in RESULT_POOL, that
+ * need to run as part of marking the conflict resolved. */
+svn_error_t *
+svn_wc__db_update_moved_away_conflict_victim(svn_skel_t **work_items,
+ const char *victim_abspath,
+ svn_wc__db_t *db,
+ svn_wc_notify_func2_t notify_func,
+ void *notify_baton,
+ svn_cancel_func_t cancel_func,
+ void *cancel_baton,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
/* @} */
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_private.h Fri Nov 2 00:57:09 2012
@@ -148,6 +148,24 @@ svn_wc__db_wcroot_parse_local_abspath(sv
#define VERIFY_USABLE_WCROOT(wcroot) SVN_ERR_ASSERT( \
(wcroot) != NULL && (wcroot)->format == SVN_WC__VERSION)
+/* Calculates the depth of the relpath below "" */
+APR_INLINE static int
+relpath_depth(const char *relpath)
+{
+ int n = 1;
+ if (*relpath == '\0')
+ return 0;
+
+ do
+ {
+ if (*relpath == '/')
+ n++;
+ }
+ while (*(++relpath));
+
+ return n;
+}
+
/* */
svn_error_t *
@@ -208,6 +226,50 @@ svn_wc__db_read_info_internal(svn_wc__db
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
+/* Like svn_wc__db_scan_deletion(), but with WCROOT+LOCAL_RELPATH instead of
+ DB+LOCAL_ABSPATH, and outputting relpaths instead of abspaths. */
+svn_error_t *
+svn_wc__db_scan_deletion_internal(const char **base_del_relpath,
+ const char **moved_to_relpath,
+ const char **work_del_relpath,
+ const char **moved_to_op_root_relpath,
+ svn_wc__db_wcroot_t *wcroot,
+ const char *local_relpath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+/* Like svn_wc__db_base_get_info(), but taking WCROOT+LOCAL_RELPATH instead of
+ DB+LOCAL_ABSPATH and outputting REPOS_ID instead of URL+UUID. */
+svn_error_t *
+svn_wc__db_base_get_info_internal(svn_wc__db_status_t *status,
+ svn_kind_t *kind,
+ svn_revnum_t *revision,
+ const char **repos_relpath,
+ apr_int64_t *repos_id,
+ svn_revnum_t *changed_rev,
+ apr_time_t *changed_date,
+ const char **changed_author,
+ svn_depth_t *depth,
+ const svn_checksum_t **checksum,
+ const char **target,
+ svn_wc__db_lock_t **lock,
+ svn_boolean_t *had_props,
+ svn_boolean_t *update_root,
+ svn_wc__db_wcroot_t *wcroot,
+ const char *local_relpath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
+
+/* Like svn_wc__db_read_conflict(), but with WCROOT+LOCAL_RELPATH instead of
+ DB+LOCAL_ABSPATH, and outputting relpaths instead of abspaths. */
+svn_error_t *
+svn_wc__db_read_conflict_internal(svn_skel_t **conflict,
+ svn_wc__db_wcroot_t *wcroot,
+ const char *local_relpath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
+
/* Transaction handling */
Modified: subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_util.c?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_util.c (original)
+++ subversion/branches/ev2-export/subversion/libsvn_wc/wc_db_util.c Fri Nov 2 00:57:09 2012
@@ -80,10 +80,10 @@ svn_wc__db_util_fetch_wc_id(apr_int64_t
/* An SQLite application defined function that allows SQL queries to
use "relpath_depth(local_relpath)". */
static svn_error_t *
-relpath_depth(svn_sqlite__context_t *sctx,
- int argc,
- svn_sqlite__value_t *values[],
- apr_pool_t *scratch_pool)
+relpath_depth_sqlite(svn_sqlite__context_t *sctx,
+ int argc,
+ svn_sqlite__value_t *values[],
+ apr_pool_t *scratch_pool)
{
const char *path = NULL;
apr_int64_t depth;
@@ -145,7 +145,7 @@ svn_wc__db_util_open_db(svn_sqlite__db_t
SVN_ERR(svn_sqlite__exec_statements(*sdb, STMT_PRAGMA_LOCKING_MODE));
SVN_ERR(svn_sqlite__create_scalar_function(*sdb, "relpath_depth", 1,
- relpath_depth, NULL));
+ relpath_depth_sqlite, NULL));
return SVN_NO_ERROR;
}
Modified: subversion/branches/ev2-export/subversion/mod_dav_svn/dav_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/mod_dav_svn/dav_svn.h?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/branches/ev2-export/subversion/mod_dav_svn/dav_svn.h Fri Nov 2 00:57:09 2012
@@ -759,7 +759,11 @@ dav_svn__authz_read_func(dav_svn__authz_
processing. See dav_new_error_tag for parameter documentation.
Note that DESC may be null (it's hard to track this down from
dav_new_error_tag()'s documentation, but see the dav_error type,
- which says that its desc field may be NULL). */
+ which says that its desc field may be NULL).
+
+ If ERROR_ID is 0, SVN_ERR_RA_DAV_REQUEST_FAILED will be used as a
+ default value for the error code.
+*/
dav_error *
dav_svn__new_error_tag(apr_pool_t *pool,
int status,
@@ -774,7 +778,11 @@ dav_svn__new_error_tag(apr_pool_t *pool,
processing. See dav_new_error for parameter documentation.
Note that DESC may be null (it's hard to track this down from
dav_new_error()'s documentation, but see the dav_error type,
- which says that its desc field may be NULL). */
+ which says that its desc field may be NULL).
+
+ If ERROR_ID is 0, SVN_ERR_RA_DAV_REQUEST_FAILED will be used as a
+ default value for the error code.
+*/
dav_error *
dav_svn__new_error(apr_pool_t *pool,
int status,
Modified: subversion/branches/ev2-export/subversion/mod_dav_svn/liveprops.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/mod_dav_svn/liveprops.c?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/mod_dav_svn/liveprops.c (original)
+++ subversion/branches/ev2-export/subversion/mod_dav_svn/liveprops.c Fri Nov 2 00:57:09 2012
@@ -277,8 +277,8 @@ insert_prop_internal(const dav_resource
int propid,
dav_prop_insert what,
apr_text_header *phdr,
- apr_pool_t *scratch_pool,
- apr_pool_t *result_pool)
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
const char *value = NULL;
const char *s;
@@ -822,7 +822,7 @@ insert_prop(const dav_resource *resource
scratch_pool = svn_pool_create(result_pool);
rv = insert_prop_internal(resource, propid, what, phdr,
- scratch_pool, result_pool);
+ result_pool, scratch_pool);
svn_pool_destroy(scratch_pool);
return rv;
@@ -960,7 +960,7 @@ dav_svn__insert_all_liveprops(request_re
{
svn_pool_clear(iterpool);
(void) insert_prop_internal(resource, spec->propid, what, phdr,
- iterpool, resource->pool);
+ resource->pool, iterpool);
}
svn_pool_destroy(iterpool);
Modified: subversion/branches/ev2-export/subversion/mod_dav_svn/reports/update.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/mod_dav_svn/reports/update.c?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/mod_dav_svn/reports/update.c (original)
+++ subversion/branches/ev2-export/subversion/mod_dav_svn/reports/update.c Fri Nov 2 00:57:09 2012
@@ -922,6 +922,49 @@ malformed_element_error(const char *tagn
}
+/* Validate that REVISION is a valid revision number for repository in
+ which YOUNGEST is the latest revision. Use RESOURCE as a
+ convenient way to access the request record and a pool for error
+ messaging. (It's okay if REVISION is SVN_INVALID_REVNUM, as in
+ the related contexts that just means "the youngest revision".)
+
+ REVTYPE is just a string describing the type/purpose of REVISION,
+ used in the generated error string. */
+static dav_error *
+validate_input_revision(svn_revnum_t revision,
+ svn_revnum_t youngest,
+ const char *revtype,
+ const dav_resource *resource)
+{
+ if (! SVN_IS_VALID_REVNUM(revision))
+ return SVN_NO_ERROR;
+
+ if (revision > youngest)
+ {
+ svn_error_t *serr;
+
+ if (dav_svn__get_master_uri(resource->info->r))
+ {
+ serr = svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, 0,
+ "No such %s '%ld' found in the repository. "
+ "Perhaps the repository is out of date with "
+ "respect to the master repository?",
+ revtype, revision);
+ }
+ else
+ {
+ serr = svn_error_createf(SVN_ERR_FS_NO_SUCH_REVISION, 0,
+ "No such %s '%ld' found in the repository.",
+ revtype, revision);
+ }
+ return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
+ "Invalid revision found in update report "
+ "request.", resource->pool);
+ }
+ return SVN_NO_ERROR;
+}
+
+
dav_error *
dav_svn__update_report(const dav_resource *resource,
const apr_xml_doc *doc,
@@ -931,8 +974,7 @@ dav_svn__update_report(const dav_resourc
apr_xml_elem *child;
void *rbaton = NULL;
update_ctx_t uc = { 0 };
- svn_revnum_t revnum = SVN_INVALID_REVNUM;
- svn_boolean_t revnum_is_head = FALSE;
+ svn_revnum_t youngest, revnum = SVN_INVALID_REVNUM;
svn_revnum_t from_revnum = SVN_INVALID_REVNUM;
int ns;
/* entry_counter and entry_is_empty are for operational logging. */
@@ -998,6 +1040,14 @@ dav_svn__update_report(const dav_resourc
}
}
+ /* Ask the repository about its youngest revision (which we'll need
+ for some input validation later). */
+ if ((serr = svn_fs_youngest_rev(&youngest, repos->fs, resource->pool)))
+ return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
+ "Could not determine the youngest "
+ "revision for the update process.",
+ resource->pool);
+
for (child = doc->root->first_child; child != NULL; child = child->next)
{
/* Note that child->name might not match any of the cases below.
@@ -1125,6 +1175,23 @@ dav_svn__update_report(const dav_resourc
}
}
+ /* If a target revision wasn't requested, or the requested target
+ revision was invalid, just update to HEAD as of the moment we
+ queried the youngest revision. Otherwise, at least make sure the
+ request makes sense in light of that youngest revision
+ number. */
+ if (! SVN_IS_VALID_REVNUM(revnum))
+ {
+ revnum = youngest;
+ }
+ else
+ {
+ derr = validate_input_revision(revnum, youngest, "target revision",
+ resource);
+ if (derr)
+ return derr;
+ }
+
if (!saw_depth && !saw_recursive && (requested_depth == svn_depth_unknown))
requested_depth = svn_depth_infinity;
@@ -1140,18 +1207,6 @@ dav_svn__update_report(const dav_resourc
SVN_DAV_ERROR_TAG);
}
- /* If a revision for this operation was not dictated to us, this
- means "update to whatever the current HEAD is now". */
- if (revnum == SVN_INVALID_REVNUM)
- {
- if ((serr = svn_fs_youngest_rev(&revnum, repos->fs, resource->pool)))
- return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
- "Could not determine the youngest "
- "revision for the update process.",
- resource->pool);
- revnum_is_head = TRUE;
- }
-
uc.svndiff_version = resource->info->svndiff_version;
uc.compression_level = dav_svn__get_compression_level(resource->info->r);
uc.resource = resource;
@@ -1270,27 +1325,10 @@ dav_svn__update_report(const dav_resourc
{
rev = SVN_STR_TO_REV(this_attr->value);
saw_rev = TRUE;
- if (revnum_is_head && rev > revnum)
- {
- if (dav_svn__get_master_uri(resource->info->r))
- return dav_svn__new_error_tag(
- resource->pool,
- HTTP_INTERNAL_SERVER_ERROR, 0,
- "A reported revision is higher than the "
- "current repository HEAD revision. "
- "Perhaps the repository is out of date "
- "with respect to the master repository?",
- SVN_DAV_ERROR_NAMESPACE,
- SVN_DAV_ERROR_TAG);
- else
- return dav_svn__new_error_tag(
- resource->pool,
- HTTP_INTERNAL_SERVER_ERROR, 0,
- "A reported revision is higher than the "
- "current repository HEAD revision.",
- SVN_DAV_ERROR_NAMESPACE,
- SVN_DAV_ERROR_TAG);
- }
+ if ((derr = validate_input_revision(rev, youngest,
+ "reported revision",
+ resource)))
+ return derr;
}
else if (strcmp(this_attr->name, "depth") == 0)
depth = svn_depth_from_word(this_attr->value);
Modified: subversion/branches/ev2-export/subversion/mod_dav_svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/mod_dav_svn/util.c?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/mod_dav_svn/util.c (original)
+++ subversion/branches/ev2-export/subversion/mod_dav_svn/util.c Fri Nov 2 00:57:09 2012
@@ -45,6 +45,9 @@ dav_svn__new_error(apr_pool_t *pool,
int error_id,
const char *desc)
{
+ if (error_id == 0)
+ error_id = SVN_ERR_RA_DAV_REQUEST_FAILED;
+
/*
* Note: dav_new_error() in httpd 2.0/2.2 always treated
* the errno field in dav_error as an apr_status_t when
@@ -70,6 +73,9 @@ dav_svn__new_error_tag(apr_pool_t *pool,
const char *namespace,
const char *tagname)
{
+ if (error_id == 0)
+ error_id = SVN_ERR_RA_DAV_REQUEST_FAILED;
+
#if AP_MODULE_MAGIC_AT_LEAST(20091119,0)
return dav_new_error_tag(pool, status, error_id, 0,
desc, namespace, tagname);
Modified: subversion/branches/ev2-export/subversion/mod_dav_svn/version.c
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/mod_dav_svn/version.c?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/mod_dav_svn/version.c (original)
+++ subversion/branches/ev2-export/subversion/mod_dav_svn/version.c Fri Nov 2 00:57:09 2012
@@ -245,11 +245,17 @@ get_option(const dav_resource *resource,
DeltaV-free! If we're configured to advise this support, do so. */
if (resource->info->repos->v2_protocol)
{
- /* The list of Subversion's custom POSTs. You'll want to keep
- this in sync with the handling of these suckers in
- handle_post_request(). */
int i;
svn_version_t *master_version = dav_svn__get_master_version(r);
+
+ /* The list of Subversion's custom POSTs and which versions of
+ Subversion support them. We need this latter information
+ when acting as a WebDAV slave -- we don't want to claim
+ support for a POST type if the master server which will
+ actually have to handle it won't recognize it.
+
+ Keep this in sync with what's handled in handle_post_request().
+ */
struct posts_versions_t {
const char *post_name;
svn_version_t min_version;
Modified: subversion/branches/ev2-export/subversion/po/es.po
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/po/es.po?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/po/es.po [UTF-8] (original)
+++ subversion/branches/ev2-export/subversion/po/es.po [UTF-8] Fri Nov 2 00:57:09 2012
@@ -13565,7 +13565,7 @@ msgstr ""
#~ " 'HEAD' lo último del repositorio\n"
#~ " 'BASE' rev base del ítem de la c. de trab.\n"
#~ " 'COMMITTED' último commit en o antes de BASE\n"
-#~ " 'PREV' revisión justo antes de COMMITED"
+#~ " 'PREV' revisión justo antes de COMMITTED"
#~ msgid "Can't open file '%s' for reading"
#~ msgstr "No se pudo abrir el archivo '%s' para leer"
Modified: subversion/branches/ev2-export/subversion/po/pt_BR.po
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/po/pt_BR.po?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/po/pt_BR.po [UTF-8] (original)
+++ subversion/branches/ev2-export/subversion/po/pt_BR.po [UTF-8] Fri Nov 2 00:57:09 2012
@@ -12663,8 +12663,8 @@ msgstr ""
#~ " '{' DATA '}' revisão no início da data\n"
#~ " 'HEAD' último no repositório\n"
#~ " 'BASE' revisão base do item da cópia de trabalho\n"
-#~ " 'COMMITED' último commit em ou antes de BASE\n"
-#~ " 'PREV' revisão exatamente antes de COMMITED"
+#~ " 'COMMITTED' último commit em ou antes de BASE\n"
+#~ " 'PREV' revisão exatamente antes de COMMITTED"
#~ msgid "Can't get user name"
#~ msgstr "Não foi possível obter o nome do usuário"
Modified: subversion/branches/ev2-export/subversion/po/zh_TW.po
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/po/zh_TW.po?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/po/zh_TW.po [UTF-8] (original)
+++ subversion/branches/ev2-export/subversion/po/zh_TW.po [UTF-8] Fri Nov 2 00:57:09 2012
@@ -12810,7 +12810,7 @@ msgstr ""
#~ " '{' DATE '}' 該日開始的修訂版\n"
#~ " 'HEAD' 檔案庫最新版本\n"
#~ " 'BASE' 該項目工作複本的基礎修訂版\n"
-#~ " 'COMMITED' 位於或早於 BASE 的最後送交\n"
+#~ " 'COMMITTED' 位於或早於 BASE 的最後送交\n"
#~ " 'PREV' COMMITTED 之前的修訂版"
#~ msgid "Error reading administrative log file in '%s'"
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/autoprop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/autoprop_tests.py?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/autoprop_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/autoprop_tests.py Fri Nov 2 00:57:09 2012
@@ -42,6 +42,7 @@ Issue = svntest.testcase.Issue_deco
Wimp = svntest.testcase.Wimp_deco
Item = svntest.wc.StateItem
+from svntest.main import SVN_PROP_INHERITABLE_AUTOPROPS
# Helper function
def check_proplist(path, exp_out):
@@ -324,6 +325,348 @@ def fail_add_mixed_eol_style(sbox):
{filename : Item(status='? ')})
run_and_verify_unquiet_status(filepath, expected_status)
+#----------------------------------------------------------------------
+
+def create_inherited_autoprops_config(config_dir, enable_flag):
+ "create config stuffs for inherited autoprops tests"
+
+ # contents of the file 'config'
+ config_contents = '''\
+[auth]
+password-stores =
+
+[miscellany]
+enable-auto-props = %s
+
+[auto-props]
+*.c = svn:keywords=Author Date Id Rev URL;svn:eol-style=native;
+''' % (enable_flag and 'yes' or 'no')
+
+ svntest.main.create_config_dir(config_dir, config_contents)
+
+#----------------------------------------------------------------------
+def check_inheritable_autoprops(sbox, auto_props_enabled):
+ """Check that the autoprops added or imported by inheritable_autoprops_test
+ are as expected based on whether traditional auto props are active or
+ not, as indicated by AUTO_PROPS_ENABLED."""
+
+ foo_path = sbox.ospath('foo.c')
+ bar_path = sbox.ospath('B/bar.c')
+ baf_path = sbox.ospath('C/baf.c')
+ qux_path = sbox.ospath('D/qux.c')
+ rip_path = sbox.ospath('D/rip.bat')
+ snk_path = sbox.ospath('D/H/snk.py')
+ sir_path = sbox.ospath('D/H/sir.c')
+
+ if auto_props_enabled:
+ check_proplist(foo_path, {'svn:eol-style':'CRLF',
+ 'svn:keywords':'Author Date Id Rev URL'})
+ check_proplist(bar_path, {'svn:eol-style':'CR',
+ 'svn:keywords':'Date'})
+ check_proplist(baf_path, {'svn:eol-style':'LF',
+ 'svn:keywords':'Rev'})
+ check_proplist(qux_path, {'svn:eol-style':'CRLF',
+ 'svn:keywords':'Author Date Id Rev URL'})
+ check_proplist(rip_path, {'svn:executable':'*'})
+ check_proplist(snk_path, {'svn:mime-type':'text/x-python'})
+ check_proplist(sir_path, {'svn:eol-style':'CRLF',
+ 'svn:keywords':'Author Date Id Rev URL'})
+ else:
+ check_proplist(foo_path, {'svn:eol-style':'CRLF'})
+ check_proplist(bar_path, {'svn:eol-style':'CR',
+ 'svn:keywords':'Date'})
+ check_proplist(baf_path, {'svn:eol-style':'LF',
+ 'svn:keywords':'Rev'})
+ check_proplist(qux_path, {'svn:eol-style':'CRLF'})
+ check_proplist(rip_path, {'svn:executable':'*'})
+ check_proplist(snk_path, {'svn:mime-type':'text/x-python'})
+ check_proplist(sir_path, {'svn:eol-style':'CRLF'})
+
+#----------------------------------------------------------------------
+def inheritable_autoprops_test(sbox, cmd, cfgenable, clienable, subdir,
+ do_import_or_add=True):
+ """configurable autoprops and svn:inheritable-auto-props test.
+
+ CMD is the subcommand to test: 'import' or 'add'
+ if CFGENABLE is true, enable autoprops in the config file, else disable
+ if CLIENABLE == 1: --auto-props is added to the command line
+ 0: nothing is added
+ -1: --no-auto-props is added to command line
+ if string SUBDIR is not empty files are created in that subdir and the
+ directory is added/imported
+ if DO_IMPORT_OR_ADD is false, setup the test, but don't perform
+ the actual import or add.
+
+ Return the directory where the config dir (if any) is located."""
+
+ # Bootstrap
+ sbox.build()
+
+ # some directories
+ wc_dir = sbox.wc_dir
+ tmp_dir = os.path.abspath(svntest.main.temp_dir)
+ config_dir = os.path.join(tmp_dir, 'autoprops_config_' + sbox.name)
+ repos_url = sbox.repo_url
+
+ # initialize parameters
+ if cmd == 'import':
+ parameters = ['import', '-m', 'importing']
+ files_dir = tmp_dir
+ else:
+ parameters = ['add']
+ files_dir = wc_dir
+
+ parameters = parameters + ['--config-dir', config_dir]
+
+ create_inherited_autoprops_config(config_dir, cfgenable)
+
+ # add comandline flags
+ if clienable == 1:
+ parameters = parameters + ['--auto-props']
+ enable_flag = 1
+ elif clienable == -1:
+ parameters = parameters + ['--no-auto-props']
+ enable_flag = 0
+ else:
+ enable_flag = cfgenable
+
+ # setup subdirectory if needed
+ if len(subdir) > 0:
+ files_dir = os.path.join(files_dir, subdir)
+ files_wc_dir = os.path.join(wc_dir, subdir)
+ os.makedirs(files_dir)
+ else:
+ files_wc_dir = wc_dir
+
+ # Set differing svn:inheritable-auto-props properties on various
+ # directories.
+ sbox.simple_propset(SVN_PROP_INHERITABLE_AUTOPROPS,
+ '*.c = svn:eol-style=CRLF\n'
+ '*.bat = svn:executable',
+ '.')
+ sbox.simple_propset(SVN_PROP_INHERITABLE_AUTOPROPS,
+ '*.c = svn:eol-style=CR;svn:keywords=Date',
+ 'A/B')
+ sbox.simple_propset(SVN_PROP_INHERITABLE_AUTOPROPS,
+ '*.c = svn:eol-style=LF;svn:keywords=Rev',
+ 'A/C')
+ sbox.simple_propset(SVN_PROP_INHERITABLE_AUTOPROPS,
+ '*.py = svn:mime-type=text/x-python',
+ 'A/D')
+ svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
+ 'Add some ' + SVN_PROP_INHERITABLE_AUTOPROPS +
+ ' properties', wc_dir)
+
+ # Switch the root of the WC to ^/A.
+ svntest.main.run_svn(None, 'switch', '--ignore-ancestry',
+ sbox.repo_url + '/A', wc_dir)
+
+ # Array of file names to add or import, their WC locations (relative to the
+ # WC root) if being added, and their repository locations if being imported.
+ filenames = [['foo.c', 'foo.c', 'A/foo.c'],
+ ['bar.c', os.path.join('B', 'bar.c'), 'A/B/bar.c'],
+ ['baf.c', os.path.join('C', 'baf.c'), 'A/C/baf.c'],
+ ['qux.c', os.path.join('D', 'qux.c'), 'A/D/qux.c'],
+ ['rip.bat', os.path.join('D', 'rip.bat'), 'A/D/rip.bat'],
+ ['snk.py', os.path.join('D', 'H', 'snk.py'), 'A/D/H/snk.py'],
+ ['ric.c', os.path.join('D', 'H', 'sir.c'), 'A/D/H/sir.c']]
+
+ for filename in filenames:
+ if cmd == 'import':
+ svntest.main.file_write(os.path.join(files_dir, filename[0]),
+ 'foo\nbar\nbaz\n')
+ else:
+ svntest.main.file_write(os.path.join(files_dir, filename[1]),
+ 'foo\nbar\nbaz\n')
+
+ if do_import_or_add:
+ if len(subdir) == 0:
+ # add/import the files
+ for filename in filenames:
+ if cmd == 'import':
+ path = os.path.join(files_dir, filename[0])
+ tmp_params = parameters + [path, repos_url + '/' + filename[2]]
+ else:
+ path = os.path.join(files_dir, filename[1])
+ tmp_params = parameters + [path]
+ svntest.main.run_svn(None, *tmp_params)
+ else:
+ # add/import subdirectory
+ if cmd == 'import':
+ parameters = parameters + [files_dir, repos_url]
+ else:
+ parameters = parameters + [files_wc_dir]
+ svntest.main.run_svn(None, *parameters)
+
+ # do an svn co if needed
+ if cmd == 'import':
+ svntest.main.run_svn(None, 'checkout', repos_url + '/A', files_wc_dir,
+ '--config-dir', config_dir)
+
+ check_inheritable_autoprops(sbox, enable_flag)
+
+ return config_dir
+
+#----------------------------------------------------------------------
+
+def svn_prop_inheritable_autoprops_add_no_none(sbox):
+ "inherit add: config=no, commandline=none"
+ inheritable_autoprops_test(sbox, 'add', False, 0, '')
+
+#----------------------------------------------------------------------
+
+def svn_prop_inheritable_autoprops_add_yes_none(sbox):
+ "inherit add: config=yes, commandline=none"
+ inheritable_autoprops_test(sbox, 'add', True, 0, '')
+
+#----------------------------------------------------------------------
+
+def svn_prop_inheritable_autoprops_add_no_yes(sbox):
+ "inherit add: config=no, commandline=yes"
+
+ inheritable_autoprops_test(sbox, 'add', 0, 1, '')
+
+#----------------------------------------------------------------------
+
+def svn_prop_inheritable_autoprops_add_yes_yes(sbox):
+ "inherit add: config=yes, commandline=yes"
+
+ inheritable_autoprops_test(sbox, 'add', 1, 1, '')
+
+#----------------------------------------------------------------------
+
+def svn_prop_inheritable_autoprops_add_no_no(sbox):
+ "inherit add: config=no, commandline=no"
+
+ inheritable_autoprops_test(sbox, 'add', 0, -1, '')
+
+#----------------------------------------------------------------------
+
+def svn_prop_inheritable_autoprops_add_yes_no(sbox):
+ "inherit add: config=yes, commandline=no"
+
+ inheritable_autoprops_test(sbox, 'add', 1, -1, '')
+
+#----------------------------------------------------------------------
+
+def svn_prop_inheritable_autoprops_import_no_none(sbox):
+ "inherit import: config=no, commandline=none"
+
+ inheritable_autoprops_test(sbox, 'import', False, 0, '')
+
+#----------------------------------------------------------------------
+
+def svn_prop_inheritable_autoprops_imp_yes_none(sbox):
+ "inherit import: config=yes, commandline=none"
+
+ inheritable_autoprops_test(sbox, 'import', 1, 0, '')
+
+#----------------------------------------------------------------------
+
+def svn_prop_inheritable_autoprops_imp_no_yes(sbox):
+ "inherit import: config=no, commandline=yes"
+
+ inheritable_autoprops_test(sbox, 'import', 0, 1, '')
+
+#----------------------------------------------------------------------
+
+def svn_prop_inheritable_autoprops_imp_yes_yes(sbox):
+ "inherit import: config=yes, commandline=yes"
+
+ inheritable_autoprops_test(sbox, 'import', 1, 1, '')
+
+#----------------------------------------------------------------------
+
+def svn_prop_inheritable_autoprops_imp_no_no(sbox):
+ "inherit import: config=no, commandline=no"
+
+ inheritable_autoprops_test(sbox, 'import', 0, -1, '')
+
+#----------------------------------------------------------------------
+
+def svn_prop_inheritable_autoprops_imp_yes_no(sbox):
+ "inherit import: config=yes, commandline=no"
+
+ inheritable_autoprops_test(sbox, 'import', 1, -1, '')
+
+#----------------------------------------------------------------------
+# Test svn:inheritable-auto-props when 'svn add' targets an already versioned
+# target.
+def svn_prop_inheritable_autoprops_add_versioned_target(sbox):
+ "svn:inheritable-auto-props and versioned target"
+
+ config_dir = inheritable_autoprops_test(sbox, 'add', 1, 0, '', False)
+
+ # Perform the add with the --force flag, and check the status.
+ ### Note: You have to be inside the working copy or else Subversion
+ ### will think you're trying to add the working copy to its parent
+ ### directory, and will (possibly, if the parent directory isn't
+ ### versioned) fail -- see also schedule_tests.py 11 "'svn add'
+ ### should traverse already-versioned dirs"
+ saved_wd = os.getcwd()
+ os.chdir(sbox.wc_dir)
+ svntest.main.run_svn(None, 'add', '.', '--force', '--config-dir',
+ config_dir)
+ os.chdir(saved_wd)
+
+ check_inheritable_autoprops(sbox, True)
+
+#----------------------------------------------------------------------
+# Can't set svn:inheritable-auto-props on files.
+def svn_prop_inheritable_autoprops_propset_file_target(sbox):
+ "svn:inheritable-auto-props can't be set on files"
+
+ sbox.build()
+ svntest.actions.run_and_verify_svn(
+ None, None,
+ ".*Cannot set '" + SVN_PROP_INHERITABLE_AUTOPROPS + "' on a file.*",
+ 'ps', SVN_PROP_INHERITABLE_AUTOPROPS, '*.c=svn:eol-style=native',
+ sbox.ospath('iota'))
+
+#----------------------------------------------------------------------
+# Multiple unversioned subtrees under a versioned target shouldn't segfault.
+def svn_prop_inheritable_autoprops_unversioned_subtrees_versioned_target(sbox):
+ "versioned target and unversioned subtrees"
+
+ sbox.build()
+ Z_path = sbox.ospath('A/D/Z')
+ Y_path = sbox.ospath('A/B/Y')
+ foo_path = sbox.ospath('A/D/Z/foo.c')
+ bar_path = sbox.ospath('A/B/Y/bar.c')
+
+ # Set svn:inheritable-auto-props properties on two directories.
+ svntest.main.run_svn(None, 'ps', SVN_PROP_INHERITABLE_AUTOPROPS,
+ '*.c=svn:eol-style=CR', sbox.ospath('A/B'))
+ svntest.main.run_svn(None, 'ps', SVN_PROP_INHERITABLE_AUTOPROPS,
+ '*.c=svn:eol-style=native', sbox.ospath('A/D'))
+ svntest.main.run_svn(None, 'ci', '-m', 'Add inheritable autoprops',
+ sbox.wc_dir)
+
+ # Create two subtrees, each with one new file.
+ os.mkdir(Z_path)
+ os.mkdir(Y_path)
+ svntest.main.file_write(foo_path,
+ '/* Someday there will be code here. */\n')
+ svntest.main.file_write(bar_path,
+ '/* Someday there will be code here. */\n')
+
+ # Perform the add with the --force flag, targeting the root of the WC.
+ ### Note: You have to be inside the working copy or else Subversion
+ ### will think you're trying to add the working copy to its parent
+ ### directory, and will (possibly, if the parent directory isn't
+ ### versioned) fail -- see also schedule_tests.py 11 "'svn add'
+ ### should traverse already-versioned dirs"
+ saved_wd = os.getcwd()
+ os.chdir(sbox.wc_dir)
+ # This was causing a segfault at one point.
+ svntest.main.run_svn(None, 'add', '.', '--force')
+ os.chdir(saved_wd)
+
+ # Check the resulting autoprops.
+ svntest.actions.run_and_verify_svn(None, 'native\n', [],
+ 'pg', 'svn:eol-style', foo_path)
+ svntest.actions.run_and_verify_svn(None, 'CR\n', [],
+ 'pg', 'svn:eol-style', bar_path)
########################################################################
# Run the tests
@@ -346,6 +689,21 @@ test_list = [ None,
autoprops_add_dir,
autoprops_imp_dir,
fail_add_mixed_eol_style,
+ svn_prop_inheritable_autoprops_add_no_none,
+ svn_prop_inheritable_autoprops_add_yes_none,
+ svn_prop_inheritable_autoprops_add_no_yes,
+ svn_prop_inheritable_autoprops_add_yes_yes,
+ svn_prop_inheritable_autoprops_add_no_no,
+ svn_prop_inheritable_autoprops_add_yes_no,
+ svn_prop_inheritable_autoprops_import_no_none,
+ svn_prop_inheritable_autoprops_imp_yes_none,
+ svn_prop_inheritable_autoprops_imp_no_yes,
+ svn_prop_inheritable_autoprops_imp_yes_yes,
+ svn_prop_inheritable_autoprops_imp_no_no,
+ svn_prop_inheritable_autoprops_imp_yes_no,
+ svn_prop_inheritable_autoprops_add_versioned_target,
+ svn_prop_inheritable_autoprops_propset_file_target,
+ svn_prop_inheritable_autoprops_unversioned_subtrees_versioned_target,
]
if __name__ == '__main__':
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/import_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/import_tests.py?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/import_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/import_tests.py Fri Nov 2 00:57:09 2012
@@ -25,11 +25,13 @@
######################################################################
# General modules
-import re, os.path
+import re, os.path, sys
# Our testing module
import svntest
from svntest import wc
+from prop_tests import create_inherited_ignores_config
+from svntest.main import SVN_PROP_INHERITABLE_IGNORES
# (abbreviation)
Skip = svntest.testcase.Skip_deco
@@ -407,6 +409,163 @@ def import_into_foreign_repo(sbox):
sbox.ospath('A/mu'), other_repo_url + '/f')
#----------------------------------------------------------------------
+def import_inherited_ignores(sbox):
+ 'import and inherited ignores'
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # Create this config file:
+ #
+ # [miscellany]
+ # global-ignores = *.boo *.goo
+ tmp_dir = os.path.abspath(svntest.main.temp_dir)
+ config_dir = os.path.join(tmp_dir, 'autoprops_config_' + sbox.name)
+ create_inherited_ignores_config(config_dir)
+
+ # Set some ignore properties.
+ sbox.simple_propset(SVN_PROP_INHERITABLE_IGNORES, '*.voo *.noo *.loo', '.')
+ sbox.simple_propset(SVN_PROP_INHERITABLE_IGNORES, '*.yoo\t*.doo', 'A/B')
+ sbox.simple_propset(SVN_PROP_INHERITABLE_IGNORES, '*.moo', 'A/D')
+ sbox.simple_propset('svn:ignore', '*.zoo\n*.foo\n*.poo', 'A/B/E')
+ sbox.simple_commit()
+
+ # Use this tree for importing:
+ #
+ # DIR1.noo
+ # DIR2.doo
+ # file1.txt
+ # DIR3.foo
+ # file2.txt
+ # DIR4.goo
+ # file3.txt
+ # file4.noo
+ # DIR5.moo
+ # file5.txt
+ # DIR6
+ # file6.foo
+ # DIR7
+ # file7.foo
+ # DIR8.noo
+ import_tree_dir = os.path.join(os.path.dirname(sys.argv[0]),
+ 'import_tests_data', 'import_tree')
+
+ # Relative WC paths of the imported tree.
+ dir1_path = os.path.join('DIR1.noo')
+ dir2_path = os.path.join('DIR2.doo')
+ file1_path = os.path.join('DIR2.doo', 'file1.txt')
+ dir3_path = os.path.join('DIR3.foo')
+ file2_path = os.path.join('DIR3.foo', 'file2.txt')
+ dir4_path = os.path.join('DIR4.goo')
+ file3_path = os.path.join('DIR4.goo', 'file3.txt')
+ file4_path = os.path.join('DIR4.goo', 'file4.txt')
+ dir5_path = os.path.join('DIR5.moo')
+ file5_path = os.path.join('DIR5.moo', 'file5.txt')
+ dir6_path = os.path.join('DIR6')
+ file6_path = os.path.join('DIR6', 'file6.foo')
+ dir7_path = os.path.join('DIR6', 'DIR7')
+ file7_path = os.path.join('DIR6', 'DIR7', 'file7.foo')
+ dir8_path = os.path.join('DIR6', 'DIR7', 'DIR8.noo')
+
+ # Import the tree to ^/A/B/E.
+ # We should never see any *.noo paths because those are blocked at the
+ # root of the repository by the svn:inheritable-ignores property. Likewise
+ # *.doo paths are blocked by the svn:inheritable-ignores on ^/A/B. Nor
+ # should we see and *.boo or *.goo paths, as those are blocked by the
+ # global-ignores config. Lastly, ^/A/B/E should not get any *.foo paths
+ # because of the svn:ignore property on ^/A/B/E, but non-immediate children
+ # of ^/A/B/E are permitted *.foo paths.
+ svntest.actions.run_and_verify_svn(None, None, [], 'import',
+ '--config-dir', config_dir,
+ import_tree_dir,
+ sbox.repo_url + '/A/B/E',
+ '-m', 'import')
+ E_path = os.path.join(wc_dir, 'A', 'B', 'E')
+ expected_output = svntest.verify.UnorderedOutput(
+ ["Updating '" + wc_dir + "':\n",
+ 'A ' + os.path.join(E_path, dir5_path) + '\n',
+ 'A ' + os.path.join(E_path, file5_path) + '\n',
+ 'A ' + os.path.join(E_path, dir6_path) + '\n',
+ 'A ' + os.path.join(E_path, file6_path) + '\n',
+ 'A ' + os.path.join(E_path, dir7_path) + '\n',
+ 'A ' + os.path.join(E_path, file7_path) + '\n',
+ 'Updated to revision 3.\n'])
+ svntest.actions.run_and_verify_svn(None, expected_output, [], 'up', wc_dir)
+
+ # Import the tree to ^/A/B/E/Z. The only difference from above is that
+ # DIR3.foo and its child file2.txt are also imported. Why? Because now
+ # we are creating a new directory in ^/A/B/E, so the svn:ignore property
+ # set on ^/A/B/E doesn't apply.
+ svntest.actions.run_and_verify_svn(None, None, [], 'import',
+ '--config-dir', config_dir,
+ import_tree_dir,
+ sbox.repo_url + '/A/B/E/Z',
+ '-m', 'import')
+ Z_path = os.path.join(wc_dir, 'A', 'B', 'E', 'Z')
+ expected_output = svntest.verify.UnorderedOutput(
+ ["Updating '" + wc_dir + "':\n",
+ 'A ' + os.path.join(Z_path) + '\n',
+ 'A ' + os.path.join(Z_path, dir5_path) + '\n',
+ 'A ' + os.path.join(Z_path, file5_path) + '\n',
+ 'A ' + os.path.join(Z_path, dir6_path) + '\n',
+ 'A ' + os.path.join(Z_path, file6_path) + '\n',
+ 'A ' + os.path.join(Z_path, dir7_path) + '\n',
+ 'A ' + os.path.join(Z_path, file7_path) + '\n',
+ 'A ' + os.path.join(Z_path, dir3_path) + '\n',
+ 'A ' + os.path.join(Z_path, file2_path) + '\n',
+ 'Updated to revision 4.\n'])
+ svntest.actions.run_and_verify_svn(None, expected_output, [], 'up', wc_dir)
+
+ # Import the tree to ^/A/B/F with the --no-ignore option.
+ # Now only the ignores present in the svn:inheritable-ignores property
+ # should be considered.
+ svntest.actions.run_and_verify_svn(None, None, [], 'import',
+ '--config-dir', config_dir,
+ '--no-ignore', import_tree_dir,
+ sbox.repo_url + '/A/B/F',
+ '-m', 'import')
+ F_path = os.path.join(wc_dir, 'A', 'B', 'F')
+ expected_output = svntest.verify.UnorderedOutput(
+ ["Updating '" + wc_dir + "':\n",
+ 'A ' + os.path.join(F_path, dir3_path) + '\n',
+ 'A ' + os.path.join(F_path, file2_path) + '\n',
+ 'A ' + os.path.join(F_path, dir4_path) + '\n',
+ 'A ' + os.path.join(F_path, file3_path) + '\n',
+ 'A ' + os.path.join(F_path, dir5_path) + '\n',
+ 'A ' + os.path.join(F_path, file5_path) + '\n',
+ 'A ' + os.path.join(F_path, dir6_path) + '\n',
+ 'A ' + os.path.join(F_path, file6_path) + '\n',
+ 'A ' + os.path.join(F_path, dir7_path) + '\n',
+ 'A ' + os.path.join(F_path, file7_path) + '\n',
+ 'Updated to revision 5.\n'])
+ svntest.actions.run_and_verify_svn(None, expected_output, [], 'up', wc_dir)
+
+ # Try importing a single file into a directory which has svn:ignore set
+ # on it with a matching pattern of the imported file. The import should
+ # be a no-op.
+ svntest.actions.run_and_verify_svn(None, [], [], 'import',
+ '--config-dir', config_dir,
+ os.path.join(import_tree_dir,
+ 'DIR6', 'file6.foo'),
+ sbox.repo_url + '/A/B/E/file6.foo',
+ '-m', 'This import should fail!')
+
+ # Try the above, but this time with --no-ignore, this time the import
+ # should succeed.
+ svntest.actions.run_and_verify_svn(None, None, [], 'import', '--no-ignore',
+ '--config-dir', config_dir,
+ os.path.join(import_tree_dir,
+ 'DIR6', 'file6.foo'),
+ sbox.repo_url + '/A/B/E/file6.foo',
+ '-m', 'import')
+ expected_output = svntest.verify.UnorderedOutput(
+ ["Updating '" + wc_dir + "':\n",
+ 'A ' + os.path.join(E_path, 'file6.foo') + '\n',
+ 'Updated to revision 6.\n'])
+ svntest.actions.run_and_verify_svn(None, expected_output, [], 'up', wc_dir)
+
+#----------------------------------------------------------------------
+
########################################################################
# Run the tests
@@ -419,6 +578,7 @@ test_list = [ None,
import_no_ignores,
import_eol_style,
import_into_foreign_repo,
+ import_inherited_ignores,
]
if __name__ == '__main__':
Propchange: subversion/branches/ev2-export/subversion/tests/cmdline/import_tests_data/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Fri Nov 2 00:57:09 2012
@@ -0,0 +1,2 @@
+[Ii]ssues?:?(\s*(,|and)?\s*#\d+)+
+(\d+)
Propchange: subversion/branches/ev2-export/subversion/tests/cmdline/import_tests_data/
------------------------------------------------------------------------------
bugtraq:url = http://subversion.tigris.org/issues/show_bug.cgi?id=%BUGID%
Propchange: subversion/branches/ev2-export/subversion/tests/cmdline/import_tests_data/
------------------------------------------------------------------------------
tsvn:logwidthmarker = 78
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/merge_tests.py Fri Nov 2 00:57:09 2012
@@ -17826,6 +17826,60 @@ def merge_with_added_subtrees_with_merge
None, None, None, None,
None, 1, 0)
+#----------------------------------------------------------------------
+@SkipUnless(server_has_mergeinfo)
+def merge_with_externals_with_mergeinfo(sbox):
+ "merge with externals with mergeinfo"
+
+ # Some paths we'll care about.
+ A_path = sbox.ospath('A')
+ A_COPY_path = sbox.ospath('A_COPY')
+ file_external_path = sbox.ospath('A/file-external')
+ mu_COPY_path = sbox.ospath('A_COPY/mu')
+ mu_path = sbox.ospath('A/mu')
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ # Make a branch of ^/A and then make a few edits under A in r3-6:
+ wc_disk, wc_status = set_up_branch(sbox)
+
+ svntest.main.file_write(mu_COPY_path, "branch edit")
+ svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
+ 'file edit on the branch', wc_dir)
+ svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+
+ # Create a file external under 'A' and set some bogus mergeinfo
+ # on it (the fact that this mergeinfo is bogus has no bearing on
+ # this test).
+ svntest.actions.run_and_verify_svn(None, None, [], 'propset',
+ 'svn:externals',
+ '^/iota file-external', A_path)
+ svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
+ 'set file external', wc_dir)
+ svntest.actions.run_and_verify_svn(None, None, [], 'up', wc_dir)
+ svntest.actions.run_and_verify_svn(None, None, [], 'ps', SVN_PROP_MERGEINFO,
+ "/bogus-mergeinfo:5", file_external_path)
+ svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
+ 'set mergeinfo on file external',
+ file_external_path)
+
+ # Sync merge ^/A to A_COPY and then reintegrate A_COPY back to A.
+ svntest.actions.run_and_verify_svn(None, None, [], 'merge',
+ sbox.repo_url + '/A', A_COPY_path)
+ svntest.actions.run_and_verify_svn(None, None, [], 'ci', '-m',
+ 'sync merge', wc_dir)
+ # This was segfaulting, see
+ # http://svn.haxx.se/dev/archive-2012-10/0364.shtml
+ svntest.actions.run_and_verify_svn(
+ None,
+ expected_merge_output(None,
+ ['U ' + mu_path + '\n',
+ ' U ' + A_path + '\n'],
+ two_url=True),
+ [], 'merge', '--reintegrate', sbox.repo_url + '/A_COPY',
+ A_path)
+
########################################################################
# Run the tests
@@ -17961,6 +18015,7 @@ test_list = [ None,
reverse_merge_with_rename,
merge_adds_then_deletes_subtree,
merge_with_added_subtrees_with_mergeinfo,
+ merge_with_externals_with_mergeinfo,
]
if __name__ == '__main__':
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/prop_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/prop_tests.py?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/prop_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/prop_tests.py Fri Nov 2 00:57:09 2012
@@ -33,6 +33,8 @@ logger = logging.getLogger()
import svntest
from svntest.main import SVN_PROP_MERGEINFO
+from svntest.main import SVN_PROP_INHERITABLE_IGNORES
+from svntest import wc
# (abbreviation)
Skip = svntest.testcase.Skip_deco
@@ -2507,6 +2509,167 @@ def pristine_props_listed(sbox):
svntest.actions.run_and_verify_svn(None, expected_output, [],
'proplist', '-R', wc_dir, '-r', 'BASE')
+def create_inherited_ignores_config(config_dir):
+ "create config stuffs for inherited ignores tests"
+
+ # contents of the file 'config'
+ config_contents = '''\
+[miscellany]
+global-ignores = *.boo *.goo
+'''
+
+ svntest.main.create_config_dir(config_dir, config_contents)
+
+def inheritable_ignores(sbox):
+ "inheritable ignores with svn:ignores and config"
+
+ sbox.build()
+ wc_dir = sbox.wc_dir
+
+ tmp_dir = os.path.abspath(svntest.main.temp_dir)
+ config_dir = os.path.join(tmp_dir, 'autoprops_config_' + sbox.name)
+ create_inherited_ignores_config(config_dir)
+
+ sbox.simple_propset(SVN_PROP_INHERITABLE_IGNORES, '*.doo', 'A/B')
+ sbox.simple_propset(SVN_PROP_INHERITABLE_IGNORES, '*.moo', 'A/D')
+ 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')
+ os.mkdir(X_dir_path)
+ os.mkdir(Y_dir_path)
+ os.mkdir(Z_dir_path)
+
+ # 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')
+ os.mkdir(boo_dir_path)
+ os.mkdir(goo_dir_path)
+ os.mkdir(doo_dir_path)
+ os.mkdir(moo_dir_path)
+ os.mkdir(foo_dir_path)
+ boo_file_path = sbox.ospath('ADD-ME-DIR-X/ignore-me-file.boo')
+ goo_file_path = sbox.ospath('A/D/G/ignore-me-file.goo')
+ doo_file_path = sbox.ospath('A/B/IGNORE-ME-DIR.doo/ignore-me-file.doo')
+ doo_file2_path = sbox.ospath('A/B/E/ignore-me-file.doo')
+ moo_file_path = sbox.ospath('A/D/ignore-me-file.moo')
+ foo_file_path = sbox.ospath('A/B/E/ignore-me-file.foo')
+ svntest.main.file_write(boo_file_path, 'I should not be versioned!\n')
+ svntest.main.file_write(goo_file_path, 'I should not be versioned!\n')
+ svntest.main.file_write(doo_file_path, 'I should not be versioned!\n')
+ svntest.main.file_write(doo_file2_path, 'I should not be versioned!\n')
+ svntest.main.file_write(moo_file_path, 'I should not be versioned!\n')
+ svntest.main.file_write(foo_file_path, 'I should not be versioned!\n')
+
+ # Some directories and files that don't match any ignore pattern
+ # but are located within a subtree that does match and so shouldn't
+ # be added.
+ roo_file_path = sbox.ospath('A/B/IGNORE-ME-DIR.doo/ignore-me-file.roo')
+ svntest.main.file_write(roo_file_path, 'I should not be versioned!\n')
+
+ # Check (non-verbose) status with the custom config. We should only see
+ # the three unversioned directories which don't match any of the ignore
+ # patterns and aren't proper subtrees of an unversioned or ignored
+ # subtree.
+ expected_output = svntest.verify.UnorderedOutput(
+ ['? ' + X_dir_path + '\n',
+ '? ' + Y_dir_path + '\n',
+ '? ' + Z_dir_path + '\n',])
+ svntest.actions.run_and_verify_svn(None, expected_output, [], 'st',
+ '--config-dir', config_dir, wc_dir)
+
+ # Check status without the custom config.
+ # Should be the same as above except the *.boo and *.goo paths
+ # now show up as unversioned '?'.
+ expected_output = svntest.verify.UnorderedOutput(
+ ['? ' + X_dir_path + '\n',
+ '? ' + Y_dir_path + '\n',
+ '? ' + Z_dir_path + '\n',
+ '? ' + boo_dir_path + '\n',
+ '? ' + goo_file_path + '\n',])
+ svntest.actions.run_and_verify_svn(None, expected_output, [], 'st', wc_dir)
+
+ # Check status with the custom config and --no-ignore.
+ expected_output = svntest.verify.UnorderedOutput(
+ ['? ' + X_dir_path + '\n',
+ '? ' + Y_dir_path + '\n',
+ '? ' + Z_dir_path + '\n',
+ 'I ' + boo_dir_path + '\n',
+ 'I ' + doo_dir_path + '\n',
+ 'I ' + doo_file2_path + '\n',
+ 'I ' + moo_dir_path + '\n',
+ 'I ' + foo_dir_path + '\n',
+ 'I ' + goo_file_path + '\n',
+ 'I ' + moo_file_path + '\n',
+ 'I ' + foo_file_path + '\n',])
+ svntest.actions.run_and_verify_svn(None, expected_output, [], 'st',
+ '--config-dir', config_dir,
+ '--no-ignore', wc_dir)
+
+ # Check status without the custom config and --no-ignore.
+ # Should be the same as above except the *.boo and *.goo paths
+ # are reported as unversioned '?' rather than ignored 'I'.
+ expected_output = svntest.verify.UnorderedOutput(
+ ['? ' + X_dir_path + '\n',
+ '? ' + Y_dir_path + '\n',
+ '? ' + Z_dir_path + '\n',
+ '? ' + boo_dir_path + '\n',
+ 'I ' + doo_dir_path + '\n',
+ 'I ' + doo_file2_path + '\n',
+ 'I ' + moo_dir_path + '\n',
+ 'I ' + foo_dir_path + '\n',
+ '? ' + goo_file_path + '\n',
+ 'I ' + moo_file_path + '\n',
+ 'I ' + foo_file_path + '\n',])
+ svntest.actions.run_and_verify_svn(None, expected_output, [], 'st',
+ '--no-ignore', wc_dir)
+
+ # Perform the add with the --force flag, targeting the root of the WC.
+ ### Note: You have to be inside the working copy or else Subversion
+ ### will think you're trying to add the working copy to its parent
+ ### directory, and will (possibly, if the parent directory isn't
+ ### versioned) fail -- see also schedule_tests.py 11 "'svn add'
+ ### should traverse already-versioned dirs"
+ saved_wd = os.getcwd()
+ os.chdir(sbox.wc_dir)
+ expected = svntest.verify.UnorderedOutput(
+ ['A ' + 'ADD-ME-DIR-X\n',
+ 'A ' + os.path.join('A', 'ADD-ME-DIR-Y.doo') + '\n',
+ 'A ' + os.path.join('A', 'D', 'G', 'ADD-ME-DIR-Z.doo') + '\n'])
+ svntest.actions.run_and_verify_svn("Adds in spite of ignores", expected,
+ [], 'add', '.', '--force',
+ '--config-dir', config_dir)
+ os.chdir(saved_wd)
+
+ # Now revert and try the add with the --no-ignore flag, only the
+ # svn:inheritable-ignores should be enforced.
+ svntest.actions.run_and_verify_svn(None, None, [], 'revert', wc_dir, '-R')
+ saved_wd = os.getcwd()
+ os.chdir(sbox.wc_dir)
+ expected = svntest.verify.UnorderedOutput(
+ ['A ' + 'ADD-ME-DIR-X\n',
+ 'A ' + os.path.join('A', 'ADD-ME-DIR-Y.doo') + '\n',
+ 'A ' + os.path.join('A', 'D', 'G', 'ADD-ME-DIR-Z.doo') + '\n',
+ 'A ' + os.path.join('ADD-ME-DIR-X', 'ignore-me-file.boo') + '\n',
+ 'A ' + 'IGNORE-ME-DIR.boo' + '\n',
+ 'A ' + os.path.join('IGNORE-ME-DIR.boo',
+ '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)
+
########################################################################
# Run the tests
@@ -2549,6 +2712,7 @@ test_list = [ None,
propget_redirection,
file_matching_dir_prop_reject,
pristine_props_listed,
+ inheritable_ignores,
]
if __name__ == '__main__':
Modified: subversion/branches/ev2-export/subversion/tests/cmdline/svnadmin_tests.py
URL: http://svn.apache.org/viewvc/subversion/branches/ev2-export/subversion/tests/cmdline/svnadmin_tests.py?rev=1404846&r1=1404845&r2=1404846&view=diff
==============================================================================
--- subversion/branches/ev2-export/subversion/tests/cmdline/svnadmin_tests.py (original)
+++ subversion/branches/ev2-export/subversion/tests/cmdline/svnadmin_tests.py Fri Nov 2 00:57:09 2012
@@ -78,6 +78,12 @@ def check_hotcopy_fsfs(src, dst):
"source" % src_dirent)
# Compare all files in this directory
for src_file in src_files:
+ # Exclude temporary files
+ if src_file == 'rev-prop-atomicsShm':
+ continue
+ if src_file == 'rev-prop-atomicsMutex':
+ continue
+
src_path = os.path.join(src_dirpath, src_file)
dst_path = os.path.join(dst_dirpath, src_file)
if not os.path.isfile(dst_path):