Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/entries.c URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/entries.c?rev=993368&r1=993367&r2=993368&view=diff ============================================================================== --- subversion/branches/javahl-ra/subversion/libsvn_wc/entries.c (original) +++ subversion/branches/javahl-ra/subversion/libsvn_wc/entries.c Tue Sep 7 13:59:41 2010 @@ -272,7 +272,10 @@ get_base_info_for_deleted(svn_wc_entry_t db, parent_abspath, scratch_pool, scratch_pool)); if (parent_status == svn_wc__db_status_added - || parent_status == svn_wc__db_status_obstructed_add) +#ifndef SVN_WC__SINGLE_DB + || parent_status == svn_wc__db_status_obstructed_add +#endif + ) SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, &parent_repos_relpath, &entry->repos, @@ -405,7 +408,10 @@ get_base_info_for_deleted(svn_wc_entry_t db, parent_abspath, scratch_pool, scratch_pool)); if (parent_status == svn_wc__db_status_added - || parent_status == svn_wc__db_status_obstructed_add) +#ifndef SVN_WC__SINGLE_DB + || parent_status == svn_wc__db_status_obstructed_add +#endif + ) SVN_ERR(svn_wc__db_scan_addition(&parent_status, NULL, NULL, NULL, NULL, @@ -649,7 +655,10 @@ read_one_entry(const svn_wc_entry_t **ne } } else if (status == svn_wc__db_status_deleted - || status == svn_wc__db_status_obstructed_delete) +#ifndef SVN_WC__SINGLE_DB + || status == svn_wc__db_status_obstructed_delete +#endif + ) { #ifdef SVN_WC__SINGLE_DB svn_node_kind_t path_kind; @@ -690,7 +699,10 @@ read_one_entry(const svn_wc_entry_t **ne #endif } else if (status == svn_wc__db_status_added - || status == svn_wc__db_status_obstructed_add) +#ifndef SVN_WC__SINGLE_DB + || status == svn_wc__db_status_obstructed_add +#endif + ) { svn_wc__db_status_t work_status; const char *op_root_abspath; @@ -772,6 +784,7 @@ read_one_entry(const svn_wc_entry_t **ne && !SVN_IS_VALID_REVNUM(entry->cmt_rev)) entry->revision = 0; +#ifndef SVN_WC__SINGLE_DB if (status == svn_wc__db_status_obstructed_add) entry->revision = SVN_INVALID_REVNUM; @@ -781,6 +794,7 @@ read_one_entry(const svn_wc_entry_t **ne && status == svn_wc__db_status_obstructed_add) entry->schedule = svn_wc_schedule_normal; else +#endif entry->schedule = svn_wc_schedule_add; } } @@ -789,6 +803,7 @@ read_one_entry(const svn_wc_entry_t **ne then we cannot begin a scan for data. The original node may have important data. Set up stuff to kill that idea off, and finish up this entry. */ +#ifndef SVN_WC__SINGLE_DB if (status == svn_wc__db_status_obstructed_add) { entry->cmt_rev = SVN_INVALID_REVNUM; @@ -796,6 +811,7 @@ read_one_entry(const svn_wc_entry_t **ne scanned_original_relpath = NULL; } else +#endif { SVN_ERR(svn_wc__db_scan_addition(&work_status, &op_root_abspath, @@ -993,12 +1009,14 @@ read_one_entry(const svn_wc_entry_t **ne entry->schedule = svn_wc_schedule_normal; entry->deleted = TRUE; } +#ifndef SVN_WC__SINGLE_DB else if (status == svn_wc__db_status_obstructed) { /* ### set some values that should (hopefully) let this directory ### be usable. */ entry->revision = SVN_INVALID_REVNUM; } +#endif else if (status == svn_wc__db_status_absent) { entry->absent = TRUE; @@ -1049,6 +1067,14 @@ read_one_entry(const svn_wc_entry_t **ne ### the last three should probably have an "implied" REPOS_RELPATH */ +#ifdef SVN_WC__SINGLE_DB + SVN_ERR_ASSERT(repos_relpath != NULL + || entry->schedule == svn_wc_schedule_delete + || status == svn_wc__db_status_not_present + || status == svn_wc__db_status_absent + || status == svn_wc__db_status_excluded + ); +#else SVN_ERR_ASSERT(repos_relpath != NULL || entry->schedule == svn_wc_schedule_delete || status == svn_wc__db_status_obstructed @@ -1058,6 +1084,7 @@ read_one_entry(const svn_wc_entry_t **ne || status == svn_wc__db_status_absent || status == svn_wc__db_status_excluded ); +#endif if (repos_relpath) entry->url = svn_path_url_add_component2(entry->repos, repos_relpath,
Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/lock.c URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/lock.c?rev=993368&r1=993367&r2=993368&view=diff ============================================================================== --- subversion/branches/javahl-ra/subversion/libsvn_wc/lock.c (original) +++ subversion/branches/javahl-ra/subversion/libsvn_wc/lock.c Tue Sep 7 13:59:41 2010 @@ -663,16 +663,23 @@ adm_available(svn_boolean_t *available, db, local_abspath, scratch_pool, scratch_pool)); if (obstructed) +#ifndef SVN_WC__SINGLE_DB *obstructed = (status == svn_wc__db_status_obstructed || status == svn_wc__db_status_obstructed_add || status == svn_wc__db_status_obstructed_delete); +#else + *obstructed = FALSE; +#endif - *available = !(status == svn_wc__db_status_obstructed || - status == svn_wc__db_status_obstructed_add || - status == svn_wc__db_status_obstructed_delete || - status == svn_wc__db_status_absent || - status == svn_wc__db_status_excluded || - status == svn_wc__db_status_not_present); + *available = !(status == svn_wc__db_status_absent + || status == svn_wc__db_status_excluded + || status == svn_wc__db_status_not_present +#ifndef SVN_WC__SINGLE_DB + || status == svn_wc__db_status_obstructed + || status == svn_wc__db_status_obstructed_add + || status == svn_wc__db_status_obstructed_delete +#endif + ); return SVN_NO_ERROR; } Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/node.c URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/node.c?rev=993368&r1=993367&r2=993368&view=diff ============================================================================== --- subversion/branches/javahl-ra/subversion/libsvn_wc/node.c (original) +++ subversion/branches/javahl-ra/subversion/libsvn_wc/node.c Tue Sep 7 13:59:41 2010 @@ -136,7 +136,10 @@ svn_wc__node_get_repos_info(const char * if (scan_added && (status == svn_wc__db_status_added - || status == svn_wc__db_status_obstructed_add)) +#ifndef SVN_WC__SINGLE_DB + || status == svn_wc__db_status_obstructed_add +#endif + )) { /* We have an addition. scan_addition() will find the intended repository location by scanning up the tree. */ @@ -153,12 +156,15 @@ svn_wc__node_get_repos_info(const char * if (((repos_root_url != NULL && *repos_root_url == NULL) || (repos_uuid != NULL && *repos_uuid == NULL)) && (status == svn_wc__db_status_normal - || status == svn_wc__db_status_obstructed || status == svn_wc__db_status_absent || status == svn_wc__db_status_excluded || status == svn_wc__db_status_not_present || (scan_deleted && (status == svn_wc__db_status_deleted)) - || (scan_deleted && (status == svn_wc__db_status_obstructed_delete)))) +#ifndef SVN_WC__SINGLE_DB + || status == svn_wc__db_status_obstructed + || (scan_deleted && (status == svn_wc__db_status_obstructed_delete)) +#endif + )) { SVN_ERR(svn_wc__db_scan_base_repos(NULL, repos_root_url, repos_uuid, wc_ctx->db, local_abspath, @@ -365,7 +371,10 @@ svn_wc__internal_node_get_url(const char || status == svn_wc__db_status_not_present || (!have_base && (status == svn_wc__db_status_deleted - || status == svn_wc__db_status_obstructed_delete))) +#ifndef SVN_WC__SINGLE_DB + || status == svn_wc__db_status_obstructed_delete +#endif + ))) { const char *parent_abspath; @@ -446,7 +455,10 @@ svn_wc__node_get_repos_relpath(const cha else if (status == svn_wc__db_status_excluded || (!have_base && (status == svn_wc__db_status_deleted - || status == svn_wc__db_status_obstructed_delete))) +#ifndef SVN_WC__SINGLE_DB + || status == svn_wc__db_status_obstructed_delete +#endif + ))) { const char *parent_abspath, *name, *parent_relpath; @@ -567,7 +579,10 @@ svn_wc__internal_get_copyfrom_info(const } } else if ((status == svn_wc__db_status_added - || status == svn_wc__db_status_obstructed_add) +#ifndef SVN_WC__SINGLE_DB + || status == svn_wc__db_status_obstructed_add +#endif + ) && (copyfrom_rev || copyfrom_url || copyfrom_root_url || copyfrom_repos_relpath)) { @@ -813,8 +828,11 @@ svn_wc__node_is_status_deleted(svn_boole wc_ctx->db, local_abspath, scratch_pool, scratch_pool)); - *is_deleted = (status == svn_wc__db_status_deleted) || - (status == svn_wc__db_status_obstructed_delete); + *is_deleted = (status == svn_wc__db_status_deleted) +#ifndef SVN_WC__SINGLE_DB + || (status == svn_wc__db_status_obstructed_delete) +#endif + ; return SVN_NO_ERROR; } @@ -900,7 +918,10 @@ svn_wc__node_is_added(svn_boolean_t *is_ wc_ctx->db, local_abspath, scratch_pool, scratch_pool)); *is_added = (status == svn_wc__db_status_added - || status == svn_wc__db_status_obstructed_add); +#ifndef SVN_WC__SINGLE_DB + || status == svn_wc__db_status_obstructed_add +#endif + ); return SVN_NO_ERROR; } @@ -936,7 +957,10 @@ svn_wc__internal_is_replaced(svn_boolean scratch_pool, scratch_pool)); *replaced = ((status == svn_wc__db_status_added - || status == svn_wc__db_status_obstructed_add) +#ifndef SVN_WC__SINGLE_DB + || status == svn_wc__db_status_obstructed_add +#endif + ) && have_base && base_status != svn_wc__db_status_not_present); @@ -1130,8 +1154,12 @@ svn_wc__node_get_commit_base_rev(svn_rev wc_ctx->db, parent_abspath, scratch_pool, scratch_pool)); +#ifndef SVN_WC__SINGLE_DB SVN_ERR_ASSERT(parent_status == svn_wc__db_status_added || parent_status == svn_wc__db_status_obstructed_add); +#else + SVN_ERR_ASSERT(parent_status == svn_wc__db_status_added); +#endif SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @@ -1280,11 +1308,15 @@ svn_wc__internal_node_get_schedule(svn_w case svn_wc__db_status_normal: case svn_wc__db_status_incomplete: +#ifndef SVN_WC__SINGLE_DB case svn_wc__db_status_obstructed: +#endif break; case svn_wc__db_status_deleted: +#ifndef SVN_WC__SINGLE_DB case svn_wc__db_status_obstructed_delete: +#endif { const char *work_del_abspath; @@ -1313,7 +1345,9 @@ svn_wc__internal_node_get_schedule(svn_w break; } case svn_wc__db_status_added: +#ifndef SVN_WC__SINGLE_DB case svn_wc__db_status_obstructed_add: +#endif { const char *op_root_abspath; const char *parent_abspath; Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/props.c URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/props.c?rev=993368&r1=993367&r2=993368&view=diff ============================================================================== --- subversion/branches/javahl-ra/subversion/libsvn_wc/props.c (original) +++ subversion/branches/javahl-ra/subversion/libsvn_wc/props.c Tue Sep 7 13:59:41 2010 @@ -1758,6 +1758,7 @@ svn_wc__get_pristine_props(apr_hash_t ** return SVN_NO_ERROR; } +#ifndef SVN_WC__SINGLE_DB /* The node is obstructed: - subdir is missing, obstructed by a file, or missing admin area @@ -1777,6 +1778,7 @@ svn_wc__get_pristine_props(apr_hash_t ** "properties are not available."), svn_dirent_local_style(local_abspath, scratch_pool)); +#endif /* status: normal, moved_here, copied, deleted */ Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/relocate.c URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/relocate.c?rev=993368&r1=993367&r2=993368&view=diff ============================================================================== --- subversion/branches/javahl-ra/subversion/libsvn_wc/relocate.c (original) +++ subversion/branches/javahl-ra/subversion/libsvn_wc/relocate.c Tue Sep 7 13:59:41 2010 @@ -118,7 +118,7 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct and that only for DAV RA implementations that rely on the DAV cache. */ SVN_ERR(svn_wc__db_global_relocate(wc_ctx->db, local_abspath, new_repos_root, - FALSE, scratch_pool)); + scratch_pool)); if (!recurse) { Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/revision_status.c URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/revision_status.c?rev=993368&r1=993367&r2=993368&view=diff ============================================================================== --- subversion/branches/javahl-ra/subversion/libsvn_wc/revision_status.c (original) +++ subversion/branches/javahl-ra/subversion/libsvn_wc/revision_status.c Tue Sep 7 13:59:41 2010 @@ -83,9 +83,12 @@ analyze_status(const char *local_abspath return SVN_NO_ERROR; } else if (status == svn_wc__db_status_added - || status == svn_wc__db_status_obstructed_add || status == svn_wc__db_status_deleted - || status == svn_wc__db_status_obstructed_delete) +#ifndef SVN_WC__SINGLE_DB + || status == svn_wc__db_status_obstructed_add + || status == svn_wc__db_status_obstructed_delete +#endif + ) { wb->result->modified = TRUE; } Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/status.c URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/status.c?rev=993368&r1=993367&r2=993368&view=diff ============================================================================== --- subversion/branches/javahl-ra/subversion/libsvn_wc/status.c (original) +++ subversion/branches/javahl-ra/subversion/libsvn_wc/status.c Tue Sep 7 13:59:41 2010 @@ -2535,12 +2535,15 @@ internal_status(svn_wc_status3_t **statu scratch_pool, scratch_pool); if ((err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND) + || node_status == svn_wc__db_status_not_present + || node_status == svn_wc__db_status_absent + || node_status == svn_wc__db_status_excluded +#ifndef SVN_WC__SINGLE_DB || node_status == svn_wc__db_status_obstructed || node_status == svn_wc__db_status_obstructed_add || node_status == svn_wc__db_status_obstructed_delete - || node_status == svn_wc__db_status_not_present - || node_status == svn_wc__db_status_absent - || node_status == svn_wc__db_status_excluded) +#endif + ) { svn_error_clear(err); node_kind = svn_wc__db_kind_unknown; Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/tree_conflicts.c URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/tree_conflicts.c?rev=993368&r1=993367&r2=993368&view=diff ============================================================================== --- subversion/branches/javahl-ra/subversion/libsvn_wc/tree_conflicts.c (original) +++ subversion/branches/javahl-ra/subversion/libsvn_wc/tree_conflicts.c Tue Sep 7 13:59:41 2010 @@ -416,11 +416,6 @@ svn_wc__serialize_conflict(svn_skel_t ** } -/* - * This function could be static, but we need to link to it - * in a unit test in tests/libsvn_wc/, so it isn't. - * (and we use it to serialize tree conflicts in log.c :( ) - */ svn_error_t * svn_wc__write_tree_conflicts(const char **conflict_data, apr_hash_t *conflicts, Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/update_editor.c URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/update_editor.c?rev=993368&r1=993367&r2=993368&view=diff ============================================================================== --- subversion/branches/javahl-ra/subversion/libsvn_wc/update_editor.c (original) +++ subversion/branches/javahl-ra/subversion/libsvn_wc/update_editor.c Tue Sep 7 13:59:41 2010 @@ -461,16 +461,22 @@ node_get_relpath_ignore_errors(svn_wc__d if (relpath) return relpath; - if (status == svn_wc__db_status_added || - status == svn_wc__db_status_obstructed_add) + if (status == svn_wc__db_status_added +#ifndef SVN_WC__SINGLE_DB + || status == svn_wc__db_status_obstructed_add +#endif + ) { svn_error_clear(svn_wc__db_scan_addition(NULL, NULL, &relpath, NULL, NULL, NULL, NULL, NULL, NULL, db, local_abspath, result_pool, scratch_pool)); } - else if (status != svn_wc__db_status_deleted && - status != svn_wc__db_status_obstructed_delete) + else if (status != svn_wc__db_status_deleted +#ifndef SVN_WC__SINGLE_DB + && status != svn_wc__db_status_obstructed_delete +#endif + ) { svn_error_clear(svn_wc__db_scan_base_repos(&relpath, NULL, NULL, db, local_abspath, @@ -1578,10 +1584,16 @@ create_tree_conflict(svn_wc_conflict_des result_pool, scratch_pool)); /* This better really be an added status. */ +#ifndef SVN_WC__SINGLE_DB SVN_ERR_ASSERT(added_status == svn_wc__db_status_added || added_status == svn_wc__db_status_obstructed_add || added_status == svn_wc__db_status_copied || added_status == svn_wc__db_status_moved_here); +#else + SVN_ERR_ASSERT(added_status == svn_wc__db_status_added + || added_status == svn_wc__db_status_copied + || added_status == svn_wc__db_status_moved_here); +#endif } else if (reason == svn_wc_conflict_reason_unversioned) { @@ -1760,7 +1772,9 @@ check_tree_conflict(svn_wc_conflict_desc switch (status) { case svn_wc__db_status_added: +#ifndef SVN_WC__SINGLE_DB case svn_wc__db_status_obstructed_add: +#endif case svn_wc__db_status_moved_here: case svn_wc__db_status_copied: /* Is it a replace? */ @@ -1801,7 +1815,9 @@ check_tree_conflict(svn_wc_conflict_desc case svn_wc__db_status_deleted: +#ifndef SVN_WC__SINGLE_DB case svn_wc__db_status_obstructed_delete: +#endif /* The node is locally deleted. */ reason = svn_wc_conflict_reason_deleted; break; @@ -1813,10 +1829,12 @@ check_tree_conflict(svn_wc_conflict_desc * So the node exists and is essentially 'normal'. We still need to * check prop and text mods, and those checks will retrieve the * missing information (hopefully). */ +#ifndef SVN_WC__SINGLE_DB case svn_wc__db_status_obstructed: /* Tree-conflicts during update are only concerned with local * modifications. We can safely update BASE, disregarding the * obstruction. So let's treat this as normal. */ +#endif case svn_wc__db_status_normal: if (action == svn_wc_conflict_action_edit) /* An edit onto a local edit or onto *no* local changes is no @@ -1840,7 +1858,9 @@ check_tree_conflict(svn_wc_conflict_desc * but the update editor will not visit the subdirectories * of a directory that it wants to delete. Therefore, we * need to start a separate crawl here. */ +#ifndef SVN_WC__SINGLE_DB if (status != svn_wc__db_status_obstructed) +#endif SVN_ERR(tree_has_local_mods(&modified, &all_mods_are_deletes, eb->db, local_abspath, eb->cancel_func, eb->cancel_baton, @@ -2543,6 +2563,7 @@ add_directory(const char *path, * conflict, so merge it with the incoming add. */ db->add_existed = TRUE; +#ifndef SVN_WC__SINGLE_DB /* Pre-single-db, a dir that was OS-deleted from the working copy * along with its .svn folder is seen 'obstructed' in this code * path. The particular situation however better matches the word @@ -2559,6 +2580,7 @@ add_directory(const char *path, do_notification(eb, db->local_abspath, svn_node_dir, svn_wc_notify_add, pool); } +#endif } } else if (kind != svn_node_none) @@ -5361,6 +5383,8 @@ close_file(void *file_baton, * If ALLOW_REMOVAL is TRUE the tweaks might cause the node for * LOCAL_ABSPATH to be removed from the WC; if ALLOW_REMOVAL is FALSE this * will not happen. + * + * ### TODO(SINGLE_DB): Remove the 'parent_stub' argument. */ static svn_error_t * tweak_node(svn_wc__db_t *db, @@ -5381,6 +5405,10 @@ tweak_node(svn_wc__db_t *db, svn_boolean_t set_repos_relpath = FALSE; svn_error_t *err; +#ifdef SVN_WC__SINGLE_DB + SVN_ERR_ASSERT(! parent_stub); +#endif + err = svn_wc__db_base_get_info(&status, &db_kind, &revision, &repos_relpath, &repos_root_url, &repos_uuid, NULL, NULL, NULL, NULL, NULL, @@ -5534,14 +5562,14 @@ tweak_entries(svn_wc__db_t *db, || status == svn_wc__db_status_absent || status == svn_wc__db_status_excluded) { - - +#ifndef SVN_WC__SINGLE_DB if (kind == svn_wc__db_kind_dir) SVN_ERR(tweak_node(db, child_abspath, svn_wc__db_kind_dir, TRUE, child_repos_relpath, new_repos_root_url, new_repos_uuid, new_rev, TRUE /* allow_removal */, iterpool)); else +#endif SVN_ERR(tweak_node(db, child_abspath, kind, FALSE, child_repos_relpath, new_repos_root_url, new_repos_uuid, new_rev, @@ -5678,6 +5706,8 @@ do_update_cleanup(svn_wc__db_t *db, case svn_wc__db_status_absent: case svn_wc__db_status_not_present: return SVN_NO_ERROR; + +#ifndef SVN_WC__SINGLE_DB case svn_wc__db_status_obstructed: case svn_wc__db_status_obstructed_add: case svn_wc__db_status_obstructed_delete: @@ -5688,6 +5718,7 @@ do_update_cleanup(svn_wc__db_t *db, new_repos_uuid, new_revision, FALSE /* allow_removal */, pool)); return SVN_NO_ERROR; +#endif /* Explicitly ignore other statii */ default: Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/upgrade.c URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/upgrade.c?rev=993368&r1=993367&r2=993368&view=diff ============================================================================== --- subversion/branches/javahl-ra/subversion/libsvn_wc/upgrade.c (original) +++ subversion/branches/javahl-ra/subversion/libsvn_wc/upgrade.c Tue Sep 7 13:59:41 2010 @@ -281,60 +281,36 @@ maybe_add_subdir(apr_array_header_t *sub } -/* Return in CHILDREN, the list of all versioned subdirectories which also - exist on disk as directories. */ +/* Return in CHILDREN, the list of all 1.6 versioned subdirectories + which also exist on disk as directories. */ static svn_error_t * get_versioned_subdirs(apr_array_header_t **children, - svn_wc__db_t *db, const char *dir_abspath, apr_pool_t *result_pool, apr_pool_t *scratch_pool) { - int wc_format; apr_pool_t *iterpool = svn_pool_create(scratch_pool); + apr_hash_t *entries; + apr_hash_index_t *hi; *children = apr_array_make(result_pool, 10, sizeof(const char *)); - SVN_ERR(svn_wc__db_temp_get_format(&wc_format, db, dir_abspath, iterpool)); - if (wc_format >= SVN_WC__WC_NG_VERSION) + SVN_ERR(svn_wc__read_entries_old(&entries, dir_abspath, + scratch_pool, iterpool)); + for (hi = apr_hash_first(scratch_pool, entries); + hi; + hi = apr_hash_next(hi)) { - const apr_array_header_t *all_children; - int i; - - SVN_ERR(svn_wc__db_read_children(&all_children, db, dir_abspath, - scratch_pool, scratch_pool)); - for (i = 0; i < all_children->nelts; ++i) - { - const char *name = APR_ARRAY_IDX(all_children, i, const char *); + const char *name = svn__apr_hash_index_key(hi); - svn_pool_clear(iterpool); + /* skip "this dir" */ + if (*name == '\0') + continue; - SVN_ERR(maybe_add_subdir(*children, dir_abspath, name, - result_pool, iterpool)); - } - } - else - { - apr_hash_t *entries; - apr_hash_index_t *hi; - - SVN_ERR(svn_wc__read_entries_old(&entries, dir_abspath, - scratch_pool, iterpool)); - for (hi = apr_hash_first(scratch_pool, entries); - hi; - hi = apr_hash_next(hi)) - { - const char *name = svn__apr_hash_index_key(hi); - - /* skip "this dir" */ - if (*name == '\0') - continue; - - svn_pool_clear(iterpool); + svn_pool_clear(iterpool); - SVN_ERR(maybe_add_subdir(*children, dir_abspath, name, - result_pool, iterpool)); - } + SVN_ERR(maybe_add_subdir(*children, dir_abspath, name, + result_pool, iterpool)); } svn_pool_destroy(iterpool); @@ -1220,10 +1196,6 @@ upgrade_to_wcng(svn_wc__db_t *db, apr_hash_t *entries; svn_wc_entry_t *this_dir; -#ifndef SVN_WC__SINGLE_DB - SVN_ERR_ASSERT(!data->sdb); -#endif - /* Don't try to mess with the WC if there are old log files left. */ /* Is the (first) log file present? */ @@ -1278,7 +1250,6 @@ upgrade_to_wcng(svn_wc__db_t *db, if (!data->sdb) { -#ifdef SVN_WC__SINGLE_DB const char *root_adm_abspath; /* In root wc construst path to temporary root wc/.svn/wcng/.svn @@ -1289,9 +1260,6 @@ upgrade_to_wcng(svn_wc__db_t *db, root_adm_abspath = svn_wc__adm_child(data->root_abspath, "", scratch_pool); SVN_ERR(svn_wc__ensure_directory(root_adm_abspath, scratch_pool)); -#else - data->root_abspath = apr_pstrdup(result_pool, dir_abspath); -#endif /* Create an empty sqlite database for this directory. */ SVN_ERR(svn_wc__db_upgrade_begin(&data->sdb, @@ -1355,16 +1323,6 @@ upgrade_to_wcng(svn_wc__db_t *db, /* All done. DB should finalize the upgrade process now. */ SVN_ERR(svn_wc__db_upgrade_finish(dir_abspath, data->sdb, scratch_pool)); - /* All subdir access batons (and locks!) will be closed. Of course, they - should have been closed/unlocked just after their own upgrade process - has run. */ - /* ### well, actually.... we don't recursively delete subdir locks here, - ### we rely upon their own upgrade processes to do it. */ -#ifndef SVN_WC__SINGLE_DB - SVN_ERR(svn_wc__db_wclock_release(db, dir_abspath, scratch_pool)); - data->sdb = NULL; -#endif - /* Zap all the obsolete files. This removes the old-style lock file. In single-db we should postpone this until we have processed all entries files into the single-db, otherwise an interrupted @@ -1373,13 +1331,11 @@ upgrade_to_wcng(svn_wc__db_t *db, use 1.6 to cleanup. */ wipe_obsolete_files(dir_abspath, scratch_pool); -#ifdef SVN_WC__SINGLE_DB /* Remove the admin dir in subdirectories of the root. */ if (!svn_dirent_is_ancestor(dir_abspath, data->root_abspath)) svn_error_clear(svn_io_remove_dir2(svn_wc__adm_child(dir_abspath, NULL, scratch_pool), FALSE, NULL, NULL, scratch_pool)); -#endif return SVN_NO_ERROR; } @@ -1547,14 +1503,24 @@ upgrade_working_copy(svn_wc__db_t *db, SVN_ERR(svn_wc__db_temp_get_format(&old_format, db, dir_abspath, iterpool)); - SVN_ERR(get_versioned_subdirs(&subdirs, db, dir_abspath, + if (old_format >= SVN_WC__WC_NG_VERSION) + { + if (notify_func) + notify_func(notify_baton, + svn_wc_create_notify(dir_abspath, svn_wc_notify_skip, + iterpool), + iterpool); + return SVN_NO_ERROR; + } + + /* At present upgrade_to_wcng removes the entries file so get the + children before calling it. */ + SVN_ERR(get_versioned_subdirs(&subdirs, dir_abspath, scratch_pool, iterpool)); - /* Upgrade this directory first. */ - if (old_format < SVN_WC__WC_NG_VERSION) - SVN_ERR(upgrade_to_wcng(db, dir_abspath, old_format, - repos_info_func, repos_info_baton, - repos_cache, data, scratch_pool, iterpool)); + SVN_ERR(upgrade_to_wcng(db, dir_abspath, old_format, + repos_info_func, repos_info_baton, + repos_cache, data, scratch_pool, iterpool)); if (notify_func) notify_func(notify_baton, @@ -1562,7 +1528,6 @@ upgrade_working_copy(svn_wc__db_t *db, iterpool), iterpool); - /* Now recurse. */ for (i = 0; i < subdirs->nelts; ++i) { const char *child_abspath = APR_ARRAY_IDX(subdirs, i, const char *); @@ -1583,6 +1548,44 @@ upgrade_working_copy(svn_wc__db_t *db, } +/* Return TRUE if LOCAL_ABSPATH is a pre-1.7 working copy root, FALSE + otherwise. */ +static svn_boolean_t +is_old_wcroot(const char *local_abspath, + apr_pool_t *scratch_pool) +{ + apr_hash_t *entries; + const char *parent_abspath, *name; + svn_wc_entry_t *entry; + svn_error_t *err = svn_wc__read_entries_old(&entries, local_abspath, + scratch_pool, scratch_pool); + if (err) + { + svn_error_clear(err); + return FALSE; + } + + svn_dirent_split(&parent_abspath, &name, local_abspath, scratch_pool); + + err = svn_wc__read_entries_old(&entries, parent_abspath, + scratch_pool, scratch_pool); + if (err) + { + svn_error_clear(err); + return TRUE; + } + + entry = apr_hash_get(entries, name, APR_HASH_KEY_STRING); + if (!entry + || entry->absent + || (entry->deleted && entry->schedule != svn_wc_schedule_add)) + { + return TRUE; + } + + return FALSE; +} + svn_error_t * svn_wc_upgrade(svn_wc_context_t *wc_ctx, const char *local_abspath, @@ -1596,9 +1599,6 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx, { svn_wc__db_t *db; struct upgrade_data_t data = { NULL }; -#if 0 - svn_boolean_t is_wcroot; -#endif /* We need a DB that does not attempt an auto-upgrade, nor require running a stale work queue. We'll handle everything manually. */ @@ -1606,15 +1606,11 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx, NULL /* ### config */, FALSE, FALSE, scratch_pool, scratch_pool)); - /* ### this expects a wc-ng working copy. sigh. fix up soonish... */ -#if 0 - SVN_ERR(svn_wc__strictly_is_wc_root(&is_wcroot, wc_ctx, local_abspath, - scratch_pool)); - if (!is_wcroot) - return svn_error_create( + if (!is_old_wcroot(local_abspath, scratch_pool)) + return svn_error_createf( SVN_ERR_WC_INVALID_OP_ON_CWD, NULL, - _("'svn upgrade' can only be run from the root of the working copy.")); -#endif + _("Cannot upgrade '%s' as it is not a pre-1.7 working copy root"), + svn_dirent_local_style(local_abspath, scratch_pool)); /* Upgrade this directory and/or its subdirectories. */ SVN_ERR(upgrade_working_copy(db, local_abspath, @@ -1624,7 +1620,6 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx, notify_func, notify_baton, scratch_pool)); -#ifdef SVN_WC__SINGLE_DB SVN_ERR(svn_wc__db_wclock_release(db, data.root_abspath, scratch_pool)); SVN_ERR(svn_wc__db_drop_root(db, data.root_abspath, scratch_pool)); SVN_ERR(svn_sqlite__close(data.sdb)); @@ -1648,7 +1643,6 @@ svn_wc_upgrade(svn_wc_context_t *wc_ctx, SVN_ERR(svn_io_remove_dir2(data.root_abspath, FALSE, NULL, NULL, scratch_pool)); } -#endif SVN_ERR(svn_wc__db_close(db)); Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/wc-metadata.sql URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/wc-metadata.sql?rev=993368&r1=993367&r2=993368&view=diff ============================================================================== --- subversion/branches/javahl-ra/subversion/libsvn_wc/wc-metadata.sql (original) +++ subversion/branches/javahl-ra/subversion/libsvn_wc/wc-metadata.sql Tue Sep 7 13:59:41 2010 @@ -741,6 +741,217 @@ CREATE TABLE NODE_DATA ( CREATE INDEX I_NODE_PARENT ON NODE_DATA (wc_id, parent_relpath); CREATE INDEX I_NODE_PATH ON NODE_DATA (wc_id, local_relpath); +/* ------------------------------------------------------------------------- */ + +/* The NODES table describes the way WORKING nodes are layered on top of + BASE nodes and on top of other WORKING nodes, due to nested tree structure + changes. The layers are modelled using the "op_depth" column. + + Each row in BASE_NODE has an associated row NODE_DATA. Additionally, each + row in WORKING_NODE has one or more associated rows in NODE_DATA. + + This table contains full node descriptions for nodes in either the BASE + or WORKING trees as described in notes/wc-ng/design. Fields relate + both to BASE and WORKING trees, unless documented otherwise. + + ### This table is to be integrated into the SCHEMA statement as soon + the experimental status of NODES is lifted. + ### This table superseeds NODE_DATA + + For illustration, with a scenario like this: + + # (0) + svn rm foo + svn cp ^/moo foo # (1) + svn rm foo/bar + touch foo/bar + svn add foo/bar # (2) + + , these are the NODES for the path foo/bar (before single-db, the + numbering of op_depth is still a bit different): + + (0) BASE_NODE -----> NODES (op_depth == 0) + (1) NODES (op_depth == 1) ( <----_ ) + (2) NODES (op_depth == 2) <----- WORKING_NODE + + 0 is the original data for foo/bar before 'svn rm foo' (if it existed). + 1 is the data for foo/bar copied in from ^/moo/bar. + 2 is the to-be-committed data for foo/bar, created by 'svn add foo/bar'. + + An 'svn revert foo/bar' would remove the NODES of (2). + + */ +-- STMT_CREATE_NODES +CREATE TABLE NODES ( + /* Working copy location related fields */ + + wc_id INTEGER NOT NULL REFERENCES WCROOT (id), + local_relpath TEXT NOT NULL, + + /* Contains the depth (= number of path segments) of the operation + modifying the working copy tree structure. All nodes below the root + of the operation (aka operation root, aka oproot) affected by the + operation will be assigned the same op_depth. + + op_depth == 0 designates the initial checkout; the BASE tree. + + */ + op_depth INTEGER NOT NULL, + + /* parent's local_relpath for aggregating children of a given parent. + this will be "" if the parent is the wcroot. Since a wcroot will + never have a WORKING node the parent_relpath will never be null, + except when op_depth == 0 and the node is a wcroot. */ + parent_relpath TEXT, + + + /* Repository location fields */ + + /* When op_depth == 0, these fields refer to the repository location of the + BASE node, the location of the initial checkout. + + When op_depth != 0, they indicate where this node was copied/moved from. + In this case, the fields are set only on the root of the operation, + and are NULL for all children. */ + repos_id INTEGER REFERENCES REPOSITORY (id), + repos_path TEXT, + revision INTEGER, + + + /* WC state fields */ + + /* In case 'op_depth' is equal to 0, this is part of the BASE tree; in + that case, all presence values except 'base-deleted' are allowed. + + + In case 'op_depth' is greater than 0, this is part of a layer of + working nodes; in that case, the following presence values apply: + + Is this node "present" or has it been excluded for some reason? + Only allowed values: normal, not-present, incomplete, base-deleted. + (the others do not make sense for the WORKING tree) + + normal: this node has been added/copied/moved-here. There may be an + underlying BASE node at this location, implying this is a replace. + Scan upwards from here looking for copyfrom or moved_here values + to detect the type of operation constructing this node. + + not-present: the node (or parent) was originally copied or moved-here. + A subtree of that source has since been deleted. There may be + underlying BASE node to replace. For a move-here or copy-here, the + records are simply removed rather than switched to not-present. + Note this reflects a deletion only. It is not possible move-away + nodes from the WORKING tree. The purported destination would receive + a copy from the original source of a copy-here/move-here, or if the + nodes were plain adds, those nodes would be shifted to that target + for addition. + + incomplete: nodes are being added into the WORKING tree, and the full + information about this node is not (yet) present. + + base-deleted: the underlying BASE node has been marked for deletion due + to a delete or a move-away (see the moved_to column to determine + which), and has not been replaced. */ + presence TEXT NOT NULL, + + /* NULL depth means "default" (typically svn_depth_infinity) */ + /* ### depth on WORKING? seems this is a BASE-only concept. how do + ### you do "files" on an added-directory? can't really ignore + ### the subdirs! */ + /* ### maybe a WC-to-WC copy can retain a depth? */ + depth TEXT, + + /* ### JF: For an old-style move, "copyfrom" info stores its source, but a + new WC-NG "move" is intended to be a "true rename" so its copyfrom + revision is implicit, being in effect (new head - 1) at commit time. + For a (new) move, we need to store or deduce the copyfrom local-relpath; + perhaps add a column called "moved_from". */ + + /* Boolean value, specifying if this node was moved here (rather than just + copied). The source of the move is specified in copyfrom_*. */ + moved_here INTEGER, + + /* If the underlying node was moved away (rather than just deleted), this + specifies the local_relpath of where the BASE node was moved to. + This is set only on the root of a move, and is NULL for all children. + + Note that moved_to never refers to *this* node. It always refers + to the "underlying" node, whether that is BASE or a child node + implied from a parent's move/copy. */ + moved_to TEXT, + + /* Repository state fields */ + + /* the kind of the new node. may be "unknown" if the node is not present. */ + kind TEXT NOT NULL, + + /* If this node was moved here or copied here, then the following fields may + have information about their source node. See BASE_NODE.changed_* for + more information. + + For an added or not-present node, these are null. */ + changed_revision INTEGER, + changed_date INTEGER, /* an APR date/time (usec since 1970) */ + changed_author TEXT, + + /* The SHA-1 checksum of the pristine text, if this node is a file and was + moved here or copied here, else NULL. */ + checksum TEXT, + + /* serialized skel of this node's properties. NULL if we + have no information about the properties (a non-present node). */ + properties BLOB, + + + /* Various cache fields */ + + /* The size in bytes of the working file when it had no local text + modifications. This means the size of the text when translated from + repository-normal format to working copy format with EOL style + translated and keywords expanded according to the properties in the + "properties" column of this row. + + NULL if this node is not a file or if the size has not (yet) been + computed. */ + translated_size INTEGER, + + /* The mod-time of the working file when it was last determined to be + logically unmodified relative to its base, taking account of keywords + and EOL style. This value is used in the change detection heuristic + used by the status command. + + NULL if this node is not a file or if this info has not yet been + determined. + */ + last_mod_time INTEGER, /* an APR date/time (usec since 1970) */ + + /* serialized skel of this node's dav-cache. could be NULL if the + node does not have any dav-cache. */ + dav_cache BLOB, + + /* for kind==symlink, this specifies the target. */ + symlink_target TEXT, + + /* The serialized file external information. */ + /* ### hack. hack. hack. + ### This information is already stored in properties, but because the + ### current working copy implementation is such a pain, we can't + ### readily retrieve it, hence this temporary cache column. + ### When it is removed, be sure to remove the extra column from + ### the db-tests. + + ### Note: This is only here as a hack, and should *NOT* be added + ### to any wc_db APIs. */ + file_external TEXT, + + + PRIMARY KEY (wc_id, local_relpath, op_depth) + + ); + +CREATE INDEX I_NODES_PARENT ON NODES (wc_id, parent_relpath); +CREATE INDEX I_NODES_PATH ON NODES (wc_id, local_relpath); + /* ------------------------------------------------------------------------- */ Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/wc-queries.sql URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/wc-queries.sql?rev=993368&r1=993367&r2=993368&view=diff ============================================================================== --- subversion/branches/javahl-ra/subversion/libsvn_wc/wc-queries.sql (original) +++ subversion/branches/javahl-ra/subversion/libsvn_wc/wc-queries.sql Tue Sep 7 13:59:41 2010 @@ -77,6 +77,15 @@ insert or replace into base_node ( values (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17); +-- STMT_INSERT_NODE +insert or replace into nodes ( + wc_id, local_relpath, op_depth, parent_relpath, repos_id, repos_path, + revision, presence, depth, kind, changed_revision, changed_date, + changed_author, checksum, properties, translated_size, last_mod_time, + dav_cache, symlink_target ) +values (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, + ?15, ?16, ?17, ?18, ?19); + -- STMT_INSERT_NODE_DATA insert or replace into node_data ( wc_id, local_relpath, op_depth, parent_relpath, presence, kind, @@ -495,6 +504,13 @@ INSERT OR REPLACE INTO BASE_NODE ( depth, symlink_target, dav_cache) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16); +-- STMT_APPLY_CHANGES_TO_BASE_NODE_DATA +INSERT OR REPLACE INTO NODE_DATA ( + wc_id, local_relpath, op_depth, parent_relpath, presence, kind, + changed_revision, changed_author, properties, checksum, + changed_date, depth, symlink_target) +VALUES (?1, ?2, 0, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12); + -- STMT_INSERT_WORKING_NODE_FROM_BASE_NODE INSERT INTO WORKING_NODE ( wc_id, local_relpath, parent_relpath, presence, kind, checksum, Modified: subversion/branches/javahl-ra/subversion/libsvn_wc/wc.h URL: http://svn.apache.org/viewvc/subversion/branches/javahl-ra/subversion/libsvn_wc/wc.h?rev=993368&r1=993367&r2=993368&view=diff ============================================================================== --- subversion/branches/javahl-ra/subversion/libsvn_wc/wc.h (original) +++ subversion/branches/javahl-ra/subversion/libsvn_wc/wc.h Tue Sep 7 13:59:41 2010 @@ -622,6 +622,18 @@ svn_wc__internal_node_get_schedule(svn_w const char *local_abspath, apr_pool_t *scratch_pool); +/* Internal version of svn_wc__node_get_copyfrom_info */ +svn_error_t * +svn_wc__internal_get_copyfrom_info(const char **copyfrom_root_url, + const char **copyfrom_repos_relpath, + const char **copyfrom_url, + svn_revnum_t *copyfrom_rev, + svn_boolean_t *is_copy_target, + svn_wc__db_t *db, + const char *local_abspath, + apr_pool_t *result_pool, + apr_pool_t *scratch_pool); + /* Upgrade the wc sqlite database given in SDB for the wc located at
