You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by hw...@apache.org on 2010/12/10 22:23:13 UTC
svn commit: r1044516 [11/22] - in /subversion/branches/ignore-mergeinfo: ./
build/ac-macros/ build/generator/ contrib/server-side/ notes/ notes/wc-ng/
subversion/bindings/javahl/native/
subversion/bindings/javahl/src/org/apache/subversion/javahl/ subve...
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/copy.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/copy.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/copy.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/copy.c Fri Dec 10 21:23:03 2010
@@ -263,120 +263,6 @@ copy_versioned_dir(svn_wc__db_t *db,
tmp_dst_abspath, dst_abspath,
scratch_pool, scratch_pool));
work_items = svn_wc__wq_merge(work_items, work_item, scratch_pool);
-
-#ifndef SVN_WC__SINGLE_DB
- if (kind == svn_node_dir)
- {
- /* Create the per-directory db in the copied directory. The
- copy is not yet connected to the parent so we don't need
- to use a workqueue. This will be removed when we
- centralise. */
- const char *dst_parent_abspath, *name;
- const char *repos_root_url, *repos_uuid;
- svn_revnum_t revision;
- svn_depth_t depth;
- svn_wc__db_status_t status;
- svn_boolean_t have_base;
-
- svn_dirent_split(&dst_parent_abspath, &name, dst_abspath,
- scratch_pool);
-
- SVN_ERR(svn_wc__db_read_info(&status,
- NULL, /* kind */
- &revision,
- NULL, /* repos_relpath */
- &repos_root_url,
- &repos_uuid,
- NULL, /* changed_rev */
- NULL, /* changed_date */
- NULL, /* changed_author */
- NULL, /* last_mod_time */
- &depth,
- NULL, /* checksum */
- NULL, /* translated_size */
- NULL, /* target */
- NULL, /* changelist */
- NULL, /* original_repos_relpath */
- NULL, /* original_root_url */
- NULL, /* original_uuid */
- NULL, /* original_revision */
- NULL, /* props_mod */
- &have_base,
- NULL, /* have_work */
- NULL, /* conflicted */
- NULL, /* lock */
- db, src_abspath,
- scratch_pool, scratch_pool));
-
- if (!repos_root_url)
- {
- if (status == svn_wc__db_status_deleted)
- {
- const char *work_del_abspath;
-
- SVN_ERR(svn_wc__db_scan_deletion(NULL, NULL, NULL,
- &work_del_abspath,
- db, src_abspath,
- scratch_pool,
- scratch_pool));
- if (work_del_abspath)
- {
- const char *parent_del_abspath
- = svn_dirent_dirname(work_del_abspath,
- scratch_pool);
-
- SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
- &repos_root_url,
- &repos_uuid,
- NULL, NULL, NULL,
- NULL,
- db,
- parent_del_abspath,
- scratch_pool,
- scratch_pool));
- }
- else
- SVN_ERR(svn_wc__db_scan_base_repos(NULL,
- &repos_root_url,
- &repos_uuid,
- db, src_abspath,
- scratch_pool,
- scratch_pool));
- }
- else if (status == svn_wc__db_status_added || !have_base)
- SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL,
- &repos_root_url,
- &repos_uuid,
- NULL, NULL, NULL, NULL,
- db, src_abspath,
- scratch_pool,
- scratch_pool));
- else
- SVN_ERR(svn_wc__db_scan_base_repos(NULL, &repos_root_url,
- &repos_uuid,
- db, src_abspath,
- scratch_pool,
- scratch_pool));
- }
-
- /* Use the repos_root as root node url, because we are going to
- remove the node directly anyway. */
- SVN_ERR(svn_wc__internal_ensure_adm(db, tmp_dst_abspath,
- repos_root_url,
- repos_root_url,
- repos_uuid, revision, depth,
- scratch_pool));
-
- /* That creates a base node which we do not want so delete it. */
- SVN_ERR(svn_wc__db_base_remove(db, tmp_dst_abspath,
- scratch_pool));
-
- /* ### Need to close the database so that Windows can move
- ### the directory. */
- SVN_ERR(svn_wc__db_temp_forget_directory(db, tmp_dst_abspath,
- scratch_pool));
- }
-#endif
}
}
@@ -385,17 +271,6 @@ copy_versioned_dir(svn_wc__db_t *db,
SVN_ERR(svn_wc__wq_run(db, dir_abspath,
cancel_func, cancel_baton, scratch_pool));
-#ifndef SVN_WC__SINGLE_DB
- if (kind == svn_node_dir)
- {
- /* The first copy only does the parent stub, this second copy
- does the full node but can only happen after the workqueue
- has moved the destination into place. */
- SVN_ERR(svn_wc__db_op_copy(db, src_abspath, dst_abspath,
- NULL, scratch_pool));
- }
-#endif
-
if (notify_func)
{
svn_wc_notify_t *notify
@@ -642,7 +517,6 @@ svn_wc_copy3(svn_wc_context_t *wc_ctx,
svn_dirent_local_style(dst_abspath, scratch_pool));
case svn_wc__db_status_deleted:
- case svn_wc__db_status_obstructed_delete:
case svn_wc__db_status_not_present:
break; /* OK to add */
@@ -656,14 +530,7 @@ svn_wc_copy3(svn_wc_context_t *wc_ctx,
SVN_ERR(svn_io_check_path(src_abspath, &src_kind, scratch_pool));
-#ifndef SINGLE_DB
- if (src_kind == svn_node_file ||
- (src_kind == svn_node_none
- && (src_db_kind == svn_wc__db_kind_file
- || src_db_kind == svn_wc__db_kind_symlink)))
-#else
if (!metadata_only)
-#endif
{
svn_node_kind_t dst_kind;
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/crop.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/crop.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/crop.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/crop.c Fri Dec 10 21:23:03 2010
@@ -251,7 +251,6 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
SVN_ERR_MALFUNCTION();
case svn_wc__db_status_added:
- case svn_wc__db_status_obstructed_add:
/* Would have to check parents if we want to allow this */
return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
_("Cannot exclude '%s': it is to be added "
@@ -259,7 +258,6 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
svn_dirent_local_style(local_abspath,
scratch_pool));
case svn_wc__db_status_deleted:
- case svn_wc__db_status_obstructed_delete:
/* Would have to check parents if we want to allow this */
return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
_("Cannot exclude '%s': it is to be deleted "
@@ -269,7 +267,6 @@ svn_wc_exclude(svn_wc_context_t *wc_ctx,
case svn_wc__db_status_normal:
case svn_wc__db_status_incomplete:
- case svn_wc__db_status_obstructed:
default:
break; /* Ok to exclude */
}
@@ -357,16 +354,14 @@ svn_wc_crop_tree2(svn_wc_context_t *wc_c
svn_dirent_local_style(local_abspath,
scratch_pool));
- if (status == svn_wc__db_status_deleted ||
- status == svn_wc__db_status_obstructed_delete)
+ if (status == svn_wc__db_status_deleted)
return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
_("Cannot crop '%s': it is going to be removed "
"from repository. Try commit instead"),
svn_dirent_local_style(local_abspath,
scratch_pool));
- if (status == svn_wc__db_status_added ||
- status == svn_wc__db_status_obstructed_add)
+ if (status == svn_wc__db_status_added)
return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
_("Cannot crop '%s': it is to be added "
"to the repository. Try commit instead"),
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/deprecated.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/deprecated.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/deprecated.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/deprecated.c Fri Dec 10 21:23:03 2010
@@ -1128,7 +1128,7 @@ svn_wc_get_ancestry(char **url,
SVN_ERR(svn_wc__get_entry(&entry, svn_wc__adm_get_db(adm_access),
local_abspath, FALSE,
- svn_node_unknown, FALSE,
+ svn_node_unknown,
pool, pool));
if (url)
@@ -1789,6 +1789,7 @@ svn_wc_get_diff_editor5(svn_wc_adm_acces
depth,
ignore_ancestry,
FALSE,
+ FALSE,
use_text_base,
reverse_order,
changelists,
@@ -1940,6 +1941,7 @@ svn_wc_diff5(svn_wc_adm_access_t *anchor
depth,
ignore_ancestry,
FALSE,
+ FALSE,
changelists,
NULL, NULL,
pool));
@@ -2045,27 +2047,11 @@ svn_wc_mark_missing_deleted(const char *
svn_wc_adm_access_t *parent,
apr_pool_t *pool)
{
-#ifdef SINGLE_DB
/* With a single DB a node will never be missing */
return svn_error_createf(SVN_ERR_WC_PATH_FOUND, NULL,
_("Unexpectedly found '%s': "
"path is marked 'missing'"),
svn_dirent_local_style(path, pool));
-#else
- const char *local_abspath;
- svn_wc_context_t *wc_ctx;
-
- SVN_ERR(svn_wc__context_create_with_db(&wc_ctx, NULL,
- svn_wc__adm_get_db(parent), pool));
-
- SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
-
- SVN_ERR(svn_wc__temp_mark_missing_not_present(local_abspath, wc_ctx, pool));
-
- SVN_ERR(svn_wc_context_destroy(wc_ctx));
-
- return SVN_NO_ERROR;
-#endif
}
@@ -2959,7 +2945,6 @@ svn_wc_get_update_editor3(svn_revnum_t *
allow_unver_obstructions,
diff3_cmd,
preserved_exts,
- fetch_func, fetch_baton,
conflict_func, conflict_baton,
external_func, eb,
cancel_func, cancel_baton,
@@ -3076,7 +3061,6 @@ svn_wc_get_switch_editor3(svn_revnum_t *
allow_unver_obstructions,
diff3_cmd,
preserved_exts,
- NULL, NULL,
conflict_func, conflict_baton,
external_func, eb,
cancel_func, cancel_baton,
@@ -3380,12 +3364,16 @@ svn_wc_relocate3(const char *path,
const char *local_abspath;
svn_wc_context_t *wc_ctx;
+ if (! recurse)
+ svn_error_create(SVN_ERR_UNSUPPORTED_FEATURE, 0,
+ _("Non-recursive relocation not supported"));
+
SVN_ERR(svn_dirent_get_absolute(&local_abspath, path, pool));
SVN_ERR(svn_wc__context_create_with_db(&wc_ctx, NULL /* config */,
svn_wc__adm_get_db(adm_access),
pool));
- SVN_ERR(svn_wc_relocate4(wc_ctx, local_abspath, from, to, recurse,
+ SVN_ERR(svn_wc_relocate4(wc_ctx, local_abspath, from, to,
validator, validator_baton, pool));
return svn_error_return(svn_wc_context_destroy(wc_ctx));
@@ -3925,7 +3913,6 @@ svn_wc__entry_versioned_internal(const s
SVN_ERR(svn_wc__get_entry_versioned(entry, svn_wc__adm_get_db(adm_access),
local_abspath, svn_node_unknown,
show_hidden,
- FALSE, /* NEED_PARENT_STUB */
pool, pool));
return SVN_NO_ERROR;
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/diff.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/diff.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/diff.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/diff.c Fri Dec 10 21:23:03 2010
@@ -227,6 +227,9 @@ struct edit_baton {
/* Should this diff not compare copied files with their source? */
svn_boolean_t show_copies_as_adds;
+ /* Are we producing a git-style diff? */
+ svn_boolean_t use_git_diff_format;
+
/* Possibly diff repos against text-bases instead of working files. */
svn_boolean_t use_text_base;
@@ -350,6 +353,7 @@ make_edit_baton(struct edit_baton **edit
svn_depth_t depth,
svn_boolean_t ignore_ancestry,
svn_boolean_t show_copies_as_adds,
+ svn_boolean_t use_git_diff_format,
svn_boolean_t use_text_base,
svn_boolean_t reverse_order,
const apr_array_header_t *changelists,
@@ -373,6 +377,7 @@ make_edit_baton(struct edit_baton **edit
eb->depth = depth;
eb->ignore_ancestry = ignore_ancestry;
eb->show_copies_as_adds = show_copies_as_adds;
+ eb->use_git_diff_format = use_git_diff_format;
eb->use_text_base = use_text_base;
eb->reverse_order = reverse_order;
eb->changelist_hash = changelist_hash;
@@ -586,8 +591,7 @@ file_diff(struct dir_baton *db,
NULL, NULL, NULL, NULL, NULL, NULL,
eb->db, local_abspath, pool, pool));
- replaced = ((status == svn_wc__db_status_added
- || status == svn_wc__db_status_obstructed_add)
+ replaced = ((status == svn_wc__db_status_added)
&& have_base
&& base_status != svn_wc__db_status_not_present);
@@ -660,11 +664,15 @@ file_diff(struct dir_baton *db,
* If the item is schedule-add *with history*, then we usually want
* to see the usual working vs. text-base comparison, which will show changes
* made since the file was copied. But in case we're showing copies as adds,
- * we need to compare the copied file to the empty file. */
+ * we need to compare the copied file to the empty file. If we're doing a git
+ * diff, and the file was copied, we need to report the file as added and
+ * diff it against the text base, so that a "copied" git diff header, and
+ * possibly a diff against the copy source, will be generated for it. */
if ((! replaced && status == svn_wc__db_status_added) ||
(replaced && ! eb->ignore_ancestry) ||
((status == svn_wc__db_status_copied ||
- status == svn_wc__db_status_moved_here) && eb->show_copies_as_adds))
+ status == svn_wc__db_status_moved_here) &&
+ (eb->show_copies_as_adds || eb->use_git_diff_format)))
{
const char *translated = NULL;
const char *working_mimetype;
@@ -689,7 +697,10 @@ file_diff(struct dir_baton *db,
pool, pool));
SVN_ERR(eb->callbacks->file_added(NULL, NULL, NULL, NULL, path,
- empty_file,
+ (! eb->show_copies_as_adds &&
+ eb->use_git_diff_format &&
+ status != svn_wc__db_status_added) ?
+ textbase : empty_file,
translated,
0, revision,
NULL,
@@ -701,16 +712,15 @@ file_diff(struct dir_baton *db,
}
else
{
- svn_boolean_t modified;
const char *translated = NULL;
apr_hash_t *baseprops;
const char *base_mimetype;
const char *working_mimetype;
apr_hash_t *workingprops;
apr_array_header_t *propchanges;
+ svn_boolean_t modified;
/* Here we deal with showing pure modifications. */
-
SVN_ERR(svn_wc__internal_text_modified_p(&modified, eb->db,
local_abspath, FALSE, TRUE,
pool));
@@ -1817,6 +1827,7 @@ svn_wc_get_diff_editor6(const svn_delta_
svn_depth_t depth,
svn_boolean_t ignore_ancestry,
svn_boolean_t show_copies_as_adds,
+ svn_boolean_t use_git_diff_format,
svn_boolean_t use_text_base,
svn_boolean_t reverse_order,
const apr_array_header_t *changelists,
@@ -1836,6 +1847,7 @@ svn_wc_get_diff_editor6(const svn_delta_
anchor_path, target,
callbacks, callback_baton,
depth, ignore_ancestry, show_copies_as_adds,
+ use_git_diff_format,
use_text_base, reverse_order, changelists,
cancel_func, cancel_baton,
result_pool));
@@ -1891,6 +1903,7 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx,
svn_depth_t depth,
svn_boolean_t ignore_ancestry,
svn_boolean_t show_copies_as_adds,
+ svn_boolean_t use_git_diff_format,
const apr_array_header_t *changelists,
svn_cancel_func_t cancel_func,
void *cancel_baton,
@@ -1921,6 +1934,7 @@ svn_wc_diff6(svn_wc_context_t *wc_ctx,
target,
callbacks, callback_baton,
depth, ignore_ancestry, show_copies_as_adds,
+ use_git_diff_format,
FALSE, FALSE, changelists,
cancel_func, cancel_baton,
pool));
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/entries.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/entries.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/entries.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/entries.c Fri Dec 10 21:23:03 2010
@@ -271,8 +271,7 @@ get_base_info_for_deleted(svn_wc_entry_t
NULL, NULL, NULL, NULL, NULL, NULL,
db, parent_abspath,
scratch_pool, scratch_pool));
- if (parent_status == svn_wc__db_status_added
- || parent_status == svn_wc__db_status_obstructed_add)
+ if (parent_status == svn_wc__db_status_added)
SVN_ERR(svn_wc__db_scan_addition(NULL, NULL,
&parent_repos_relpath,
&entry->repos,
@@ -404,8 +403,7 @@ get_base_info_for_deleted(svn_wc_entry_t
NULL, NULL, NULL, NULL, NULL, NULL,
db, parent_abspath,
scratch_pool, scratch_pool));
- if (parent_status == svn_wc__db_status_added
- || parent_status == svn_wc__db_status_obstructed_add)
+ if (parent_status == svn_wc__db_status_added)
SVN_ERR(svn_wc__db_scan_addition(&parent_status,
NULL,
NULL, NULL, NULL,
@@ -648,35 +646,12 @@ read_one_entry(const svn_wc_entry_t **ne
entry->incomplete = (status == svn_wc__db_status_incomplete);
}
}
- else if (status == svn_wc__db_status_deleted
- || status == svn_wc__db_status_obstructed_delete)
+ else if (status == svn_wc__db_status_deleted)
{
-#ifdef SVN_WC__SINGLE_DB
svn_node_kind_t path_kind;
-#endif
/* ### we don't have to worry about moves, so this is a delete. */
entry->schedule = svn_wc_schedule_delete;
- /* ### keep_local ... ugh. hacky. */
- /* We only read keep_local in the directory itself, because we
- can't rely on the actual record being available in the parent
- stub when the directory is recorded as deleted in the directory
- itself. (This last value is the status that brought us in this
- if block).
-
- This is safe because we will only write this flag in the
- directory itself (see mark_deleted() in adm_ops.c), and also
- because we will never use keep_local in the final version of
- WC-NG. With a central db and central pristine store we can
- remove working copy directories directly. So any left over
- directories after the delete operation are always kept locally.
- */
-#ifndef SVN_WC__SINGLE_DB
- if (*entry->name == '\0')
- SVN_ERR(svn_wc__db_temp_determine_keep_local(&entry->keep_local,
- db, entry_abspath,
- scratch_pool));
-#else
/* If there is still a directory on-disk we keep it, if not it is
already deleted. Simple, isn't it?
@@ -687,10 +662,8 @@ read_one_entry(const svn_wc_entry_t **ne
*/
SVN_ERR(svn_io_check_path(entry_abspath, &path_kind, scratch_pool));
entry->keep_local = (path_kind == svn_node_dir);
-#endif
}
- else if (status == svn_wc__db_status_added
- || status == svn_wc__db_status_obstructed_add)
+ else if (status == svn_wc__db_status_added)
{
svn_wc__db_status_t work_status;
const char *op_root_abspath;
@@ -736,66 +709,22 @@ read_one_entry(const svn_wc_entry_t **ne
}
else
{
- /* If we are reading child directories, then we need to
- correctly populate the DELETED flag. WC_DB normally
- wants to provide all of a directory's metadata from
- its own area. But this information is stored only in
- the parent directory, so we need to call a custom API
- to fetch this value.
-
- ### we should start generating BASE_NODE rows for THIS_DIR
- ### in the subdir. future step because it is harder. */
- if (kind == svn_wc__db_kind_dir && *entry->name != '\0')
- {
- SVN_ERR(svn_wc__db_temp_is_dir_deleted(&entry->deleted,
- &entry->revision,
- db, entry_abspath,
- scratch_pool));
- }
- if (entry->deleted)
- {
- /* There was a DELETED marker in the parent, meaning
- that we truly are shadowing a base node. It isn't
- called a 'replace' though (the BASE is pretending
- not to exist). */
- entry->schedule = svn_wc_schedule_add;
- }
- else
- {
- /* There was NOT a 'not-present' BASE_NODE in the parent
- directory. And there is no BASE_NODE in this directory.
- Therefore, we are looking at some kind of add/copy
- rather than a replace. */
-
- /* ### if this looks like a plain old add, then rev=0. */
- if (!SVN_IS_VALID_REVNUM(entry->copyfrom_rev)
- && !SVN_IS_VALID_REVNUM(entry->cmt_rev))
- entry->revision = 0;
-
- if (status == svn_wc__db_status_obstructed_add)
- entry->revision = SVN_INVALID_REVNUM;
-
- /* ### when we're reading a directory that is not present,
- ### then it must be "normal" rather than "add". */
- if (*entry->name == '\0'
- && status == svn_wc__db_status_obstructed_add)
- entry->schedule = svn_wc_schedule_normal;
- else
- entry->schedule = svn_wc_schedule_add;
- }
+ /* There is NO 'not-present' BASE_NODE for this node.
+ Therefore, we are looking at some kind of add/copy
+ rather than a replace. */
+
+ /* ### if this looks like a plain old add, then rev=0. */
+ if (!SVN_IS_VALID_REVNUM(entry->copyfrom_rev)
+ && !SVN_IS_VALID_REVNUM(entry->cmt_rev))
+ entry->revision = 0;
+
+ entry->schedule = svn_wc_schedule_add;
}
/* If we don't have "real" data from the entry (obstruction),
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. */
- if (status == svn_wc__db_status_obstructed_add)
- {
- entry->cmt_rev = SVN_INVALID_REVNUM;
- work_status = svn_wc__db_status_normal;
- scanned_original_relpath = NULL;
- }
- else
{
SVN_ERR(svn_wc__db_scan_addition(&work_status,
&op_root_abspath,
@@ -993,12 +922,6 @@ read_one_entry(const svn_wc_entry_t **ne
entry->schedule = svn_wc_schedule_normal;
entry->deleted = TRUE;
}
- else if (status == svn_wc__db_status_obstructed)
- {
- /* ### set some values that should (hopefully) let this directory
- ### be usable. */
- entry->revision = SVN_INVALID_REVNUM;
- }
else if (status == svn_wc__db_status_absent)
{
entry->absent = TRUE;
@@ -1051,13 +974,9 @@ read_one_entry(const svn_wc_entry_t **ne
*/
SVN_ERR_ASSERT(repos_relpath != NULL
|| entry->schedule == svn_wc_schedule_delete
- || 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_not_present
|| status == svn_wc__db_status_absent
- || status == svn_wc__db_status_excluded
- );
+ || status == svn_wc__db_status_excluded);
if (repos_relpath)
entry->url = svn_path_url_add_component2(entry->repos,
repos_relpath,
@@ -1307,7 +1226,7 @@ read_entries(apr_hash_t **entries,
which the entry information is located, and *ENTRY_NAME to the entry name
to access that entry.
- KIND and NEED_PARENT_STUB are as in svn_wc__get_entry().
+ KIND is as in svn_wc__get_entry().
Return the results in RESULT_POOL and use SCRATCH_POOL for temporary
allocations. */
@@ -1317,16 +1236,12 @@ get_entry_access_info(const char **adm_a
svn_wc__db_t *db,
const char *local_abspath,
svn_node_kind_t kind,
- svn_boolean_t need_parent_stub,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
svn_wc_adm_access_t *adm_access;
svn_boolean_t read_from_subdir = FALSE;
- /* Can't ask for the parent stub if the node is a file. */
- SVN_ERR_ASSERT(!need_parent_stub || kind != svn_node_file);
-
/* If the caller didn't know the node kind, then stat the path. Maybe
it is really there, and we can speed up the steps below. */
if (kind == svn_node_unknown)
@@ -1370,10 +1285,10 @@ get_entry_access_info(const char **adm_a
{
/* We found a directory for this UNKNOWN node. Determine whether
we need to read inside it. */
- read_from_subdir = !need_parent_stub;
+ read_from_subdir = TRUE;
}
}
- else if (kind == svn_node_dir && !need_parent_stub)
+ else if (kind == svn_node_dir)
{
read_from_subdir = TRUE;
}
@@ -1403,19 +1318,14 @@ svn_wc__get_entry(const svn_wc_entry_t *
const char *local_abspath,
svn_boolean_t allow_unversioned,
svn_node_kind_t kind,
- svn_boolean_t need_parent_stub,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
const char *dir_abspath;
const char *entry_name;
- /* Can't ask for the parent stub if the node is a file. */
- SVN_ERR_ASSERT(!need_parent_stub || kind != svn_node_file);
-
SVN_ERR(get_entry_access_info(&dir_abspath, &entry_name, db, local_abspath,
- kind, need_parent_stub, scratch_pool,
- scratch_pool));
+ kind, scratch_pool, scratch_pool));
{
const svn_wc_entry_t *parent_entry;
@@ -1464,8 +1374,7 @@ svn_wc__get_entry(const svn_wc_entry_t *
Redo the fetch, but "insist" we are trying to find a file.
This will read from the parent directory of the "file". */
err = svn_wc__get_entry(entry, db, local_abspath, allow_unversioned,
- svn_node_file, FALSE,
- result_pool, scratch_pool);
+ svn_node_file, result_pool, scratch_pool);
if (err == SVN_NO_ERROR)
return SVN_NO_ERROR;
if (err->apr_err != SVN_ERR_NODE_UNEXPECTED_KIND)
@@ -1503,25 +1412,6 @@ svn_wc__get_entry(const svn_wc_entry_t *
svn_dirent_local_style(local_abspath,
scratch_pool));
- if (kind == svn_node_unknown)
- {
- /* They wanted a (directory) stub, but this isn't a directory. */
- if (need_parent_stub && (*entry)->kind != svn_node_dir)
- return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
- _("'%s' is not of the right kind"),
- svn_dirent_local_style(local_abspath,
- scratch_pool));
-
- /* The actual (directory) information was wanted, but we got a stub. */
- if (!need_parent_stub
- && (*entry)->kind == svn_node_dir
- && *(*entry)->name != '\0')
- return svn_error_createf(SVN_ERR_NODE_UNEXPECTED_KIND, NULL,
- _("'%s' is not of the right kind"),
- svn_dirent_local_style(local_abspath,
- scratch_pool));
- }
-
return SVN_NO_ERROR;
}
@@ -1614,7 +1504,8 @@ svn_wc_entries_read(apr_hash_t **entries
}
-/* */
+/* No transaction required: called from write_entry which is itself
+ transaction-wrapped. */
static svn_error_t *
insert_base_node(svn_sqlite__db_t *sdb,
const db_base_node_t *base_node,
@@ -1622,6 +1513,10 @@ insert_base_node(svn_sqlite__db_t *sdb,
{
svn_sqlite__stmt_t *stmt;
+#ifndef SVN_WC__NODES_ONLY
+ /* ### NODE_DATA when switching to NODE_DATA, replace the
+ query below with STMT_INSERT_BASE_NODE_DATA_FOR_ENTRY_1
+ and adjust the parameters bound. Can't do that yet. */
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
STMT_INSERT_BASE_NODE_FOR_ENTRY));
@@ -1650,13 +1545,8 @@ insert_base_node(svn_sqlite__db_t *sdb,
SVN_ERR(svn_sqlite__bind_int64(stmt, 7, base_node->revision));
- /* ### in per-subdir operation, if we're about to write a directory and
- ### it is *not* "this dir", then we're writing a row in the parent
- ### directory about the child. note that in the kind. */
/* ### kind might be "symlink" or "unknown" */
- if (base_node->kind == svn_node_dir && *base_node->local_relpath != '\0')
- SVN_ERR(svn_sqlite__bind_text(stmt, 8, "subdir"));
- else if (base_node->kind == svn_node_none)
+ if (base_node->kind == svn_node_none)
SVN_ERR(svn_sqlite__bind_text(stmt, 5, "unknown"));
else
SVN_ERR(svn_sqlite__bind_text(stmt, 8,
@@ -1686,7 +1576,69 @@ insert_base_node(svn_sqlite__db_t *sdb,
scratch_pool));
/* Execute and reset the insert clause. */
- return svn_error_return(svn_sqlite__insert(NULL, stmt));
+ SVN_ERR(svn_sqlite__insert(NULL, stmt));
+
+#endif
+#ifdef SVN_WC__NODES
+
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb,
+ STMT_INSERT_BASE_NODE_FOR_ENTRY_1));
+
+ SVN_ERR(svn_sqlite__bindf(stmt, "issisr",
+ base_node->wc_id,
+ base_node->local_relpath,
+ base_node->parent_relpath,
+ base_node->repos_id,
+ base_node->repos_relpath,
+ base_node->revision));
+
+ if (base_node->presence == svn_wc__db_status_not_present)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 7, "not-present"));
+ else if (base_node->presence == svn_wc__db_status_normal)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 7, "normal"));
+ else if (base_node->presence == svn_wc__db_status_absent)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 7, "absent"));
+ else if (base_node->presence == svn_wc__db_status_incomplete)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 7, "incomplete"));
+ else if (base_node->presence == svn_wc__db_status_excluded)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 7, "excluded"));
+
+ /* ### kind might be "symlink" or "unknown" */
+ if (base_node->kind == svn_node_none)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 8, "unknown"));
+ else
+ SVN_ERR(svn_sqlite__bind_text(stmt, 8,
+ svn_node_kind_to_word(base_node->kind)));
+
+ if (base_node->checksum)
+ SVN_ERR(svn_sqlite__bind_checksum(stmt, 9, base_node->checksum,
+ scratch_pool));
+
+ /* ### strictly speaking, changed_rev should be valid for present nodes. */
+ if (SVN_IS_VALID_REVNUM(base_node->changed_rev))
+ SVN_ERR(svn_sqlite__bind_int64(stmt, 10, base_node->changed_rev));
+ if (base_node->changed_date)
+ SVN_ERR(svn_sqlite__bind_int64(stmt, 11, base_node->changed_date));
+ if (base_node->changed_author)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 12, base_node->changed_author));
+
+ SVN_ERR(svn_sqlite__bind_text(stmt, 13, svn_depth_to_word(base_node->depth)));
+
+ if (base_node->properties)
+ SVN_ERR(svn_sqlite__bind_properties(stmt, 14, base_node->properties,
+ scratch_pool));
+
+ if (base_node->translated_size != SVN_INVALID_FILESIZE)
+ SVN_ERR(svn_sqlite__bind_int64(stmt, 15, base_node->translated_size));
+
+ SVN_ERR(svn_sqlite__bind_int64(stmt, 16, base_node->last_mod_time));
+
+ /* Execute and reset the insert clause. */
+ SVN_ERR(svn_sqlite__insert(NULL, stmt));
+
+
+#endif
+ return SVN_NO_ERROR;
}
/* */
@@ -1697,6 +1649,10 @@ insert_working_node(svn_sqlite__db_t *sd
{
svn_sqlite__stmt_t *stmt;
+#ifndef SVN_WC__NODES_ONLY
+ /* ### NODE_DATA when switching to NODE_DATA, replace the
+ query below with STMT_INSERT_WORKING_NODE_DATA_2
+ and adjust the parameters bound. Can't do that yet. */
SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_INSERT_WORKING_NODE));
SVN_ERR(svn_sqlite__bind_int64(stmt, 1, working_node->wc_id));
@@ -1715,13 +1671,7 @@ insert_working_node(svn_sqlite__db_t *sd
else if (working_node->presence == svn_wc__db_status_excluded)
SVN_ERR(svn_sqlite__bind_text(stmt, 4, "excluded"));
- /* ### in per-subdir operation, if we're about to write a directory and
- ### it is *not* "this dir", then we're writing a row in the parent
- ### directory about the child. note that in the kind. */
- if (working_node->kind == svn_node_dir
- && *working_node->local_relpath != '\0')
- SVN_ERR(svn_sqlite__bind_text(stmt, 5, "subdir"));
- else if (working_node->kind == svn_node_none)
+ if (working_node->kind == svn_node_none)
SVN_ERR(svn_sqlite__bind_text(stmt, 5, "unknown"));
else
SVN_ERR(svn_sqlite__bind_text(stmt, 5,
@@ -1770,7 +1720,64 @@ insert_working_node(svn_sqlite__db_t *sd
/* ### we should bind 'symlink_target' (20) as appropriate. */
/* Execute and reset the insert clause. */
- return svn_error_return(svn_sqlite__insert(NULL, stmt));
+ SVN_ERR(svn_sqlite__insert(NULL, stmt));
+#endif
+
+#ifdef SVN_WC__NODES
+ SVN_ERR(svn_sqlite__get_statement(&stmt, sdb, STMT_INSERT_NODE));
+ SVN_ERR(svn_sqlite__bindf(stmt, "isisnnnnsnrisnnni",
+ working_node->wc_id, working_node->local_relpath,
+ (working_node->parent_relpath == NULL
+ ? (apr_int64_t)1 : (apr_int64_t)2),
+ working_node->parent_relpath,
+ /* Setting depth for files? */
+ svn_depth_to_word(working_node->depth),
+ working_node->changed_rev,
+ working_node->changed_date,
+ working_node->changed_author,
+ working_node->last_mod_time));
+
+ if (working_node->copyfrom_repos_path)
+ {
+ SVN_ERR(svn_sqlite__bind_int64(stmt, 5,
+ working_node->copyfrom_repos_id));
+ SVN_ERR(svn_sqlite__bind_text(stmt, 6,
+ working_node->copyfrom_repos_path));
+ SVN_ERR(svn_sqlite__bind_int64(stmt, 7, working_node->copyfrom_revnum));
+ }
+
+ if (working_node->presence == svn_wc__db_status_normal)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 8, "normal"));
+ else if (working_node->presence == svn_wc__db_status_not_present)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 8, "not-present"));
+ else if (working_node->presence == svn_wc__db_status_base_deleted)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 8, "base-deleted"));
+ else if (working_node->presence == svn_wc__db_status_incomplete)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 8, "incomplete"));
+ else if (working_node->presence == svn_wc__db_status_excluded)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 8, "excluded"));
+
+ if (working_node->kind == svn_node_none)
+ SVN_ERR(svn_sqlite__bind_text(stmt, 10, "unknown"));
+ else
+ SVN_ERR(svn_sqlite__bind_text(stmt, 10,
+ svn_node_kind_to_word(working_node->kind)));
+
+ if (working_node->kind == svn_wc__db_kind_file)
+ SVN_ERR(svn_sqlite__bind_checksum(stmt, 14, working_node->checksum,
+ scratch_pool));
+
+ if (working_node->properties)
+ SVN_ERR(svn_sqlite__bind_properties(stmt, 15, working_node->properties,
+ scratch_pool));
+
+ if (working_node->translated_size != SVN_INVALID_FILESIZE)
+ SVN_ERR(svn_sqlite__bind_int64(stmt, 16, working_node->translated_size));
+
+ SVN_ERR(svn_sqlite__insert(NULL, stmt));
+#endif
+
+ return SVN_NO_ERROR;
}
/* */
@@ -2032,12 +2039,25 @@ write_entry(svn_wc__db_t *db,
{
base_node->kind = entry->kind;
- if (entry->incomplete)
+ /* All subdirs are initially incomplete, they stop being
+ incomplete when the entries file in the subdir is
+ upgraded and remain incomplete if that doesn't happen. */
+ if (entry->kind == svn_node_dir
+ && strcmp(entry->name, SVN_WC_ENTRY_THIS_DIR))
{
- /* ### nobody should have set the presence. */
- SVN_ERR_ASSERT(base_node->presence == svn_wc__db_status_normal);
base_node->presence = svn_wc__db_status_incomplete;
}
+ else
+ {
+
+ if (entry->incomplete)
+ {
+ /* ### nobody should have set the presence. */
+ SVN_ERR_ASSERT(base_node->presence
+ == svn_wc__db_status_normal);
+ base_node->presence = svn_wc__db_status_incomplete;
+ }
+ }
}
if (entry->kind == svn_node_dir)
@@ -2153,7 +2173,15 @@ write_entry(svn_wc__db_t *db,
svn_checksum_md5,
entry->checksum, scratch_pool));
- if (entry->schedule == svn_wc_schedule_delete)
+ /* All subdirs start of incomplete, and stop being incomplete
+ when the entries file in the subdir is upgraded. */
+ if (entry->kind == svn_node_dir
+ && strcmp(entry->name, SVN_WC_ENTRY_THIS_DIR))
+ {
+ working_node->presence = svn_wc__db_status_incomplete;
+ working_node->kind = svn_node_dir;
+ }
+ else if (entry->schedule == svn_wc_schedule_delete)
{
if (entry->incomplete)
{
@@ -2227,7 +2255,8 @@ struct entries_write_baton
svn_wc__db_t *db;
apr_int64_t repos_id;
apr_int64_t wc_id;
- const char *local_abspath;
+ const char *dir_abspath;
+ const char *new_root_abspath;
apr_hash_t *entries;
};
@@ -2240,11 +2269,12 @@ entries_write_new_cb(void *baton,
{
struct entries_write_baton *ewb = baton;
svn_wc__db_t *db = ewb->db;
- const char *local_abspath = ewb->local_abspath;
+ const char *dir_abspath = ewb->dir_abspath;
+ const char *new_root_abspath = ewb->new_root_abspath;
const svn_wc_entry_t *this_dir;
apr_hash_index_t *hi;
apr_pool_t *iterpool = svn_pool_create(scratch_pool);
- const char *repos_root;
+ const char *repos_root, *old_root_abspath, *dir_relpath;
/* Get a copy of the "this dir" entry for comparison purposes. */
this_dir = apr_hash_get(ewb->entries, SVN_WC_ENTRY_THIS_DIR,
@@ -2254,13 +2284,24 @@ entries_write_new_cb(void *baton,
if (! this_dir)
return svn_error_createf(SVN_ERR_ENTRY_NOT_FOUND, NULL,
_("No default entry in directory '%s'"),
- svn_dirent_local_style(local_abspath,
+ svn_dirent_local_style(dir_abspath,
iterpool));
repos_root = this_dir->repos;
+ old_root_abspath = svn_dirent_get_longest_ancestor(dir_abspath,
+ new_root_abspath,
+ scratch_pool);
+
+ SVN_ERR_ASSERT(old_root_abspath[0]);
+
+ dir_relpath = svn_dirent_skip_ancestor(old_root_abspath, dir_abspath);
+
/* Write out "this dir" */
SVN_ERR(write_entry(db, sdb, ewb->wc_id, ewb->repos_id, repos_root,
- this_dir, SVN_WC_ENTRY_THIS_DIR, local_abspath,
+ this_dir,
+ dir_relpath,
+ svn_dirent_join(new_root_abspath, dir_relpath,
+ scratch_pool),
this_dir, FALSE, FALSE, iterpool));
for (hi = apr_hash_first(scratch_pool, ewb->entries); hi;
@@ -2268,7 +2309,7 @@ entries_write_new_cb(void *baton,
{
const char *name = svn__apr_hash_index_key(hi);
const svn_wc_entry_t *this_entry = svn__apr_hash_index_val(hi);
- const char *child_abspath;
+ const char *child_abspath, *child_relpath;
svn_pool_clear(iterpool);
@@ -2278,9 +2319,14 @@ entries_write_new_cb(void *baton,
/* Write the entry. Pass TRUE for create locks, because we still
use this function for upgrading old working copies. */
- child_abspath = svn_dirent_join(local_abspath, name, iterpool);
+ child_abspath = svn_dirent_join(dir_abspath, name, iterpool);
+ child_relpath = svn_dirent_skip_ancestor(old_root_abspath, child_abspath);
SVN_ERR(write_entry(db, sdb, ewb->wc_id, ewb->repos_id, repos_root,
- this_entry, name, child_abspath, this_dir,
+ this_entry,
+ child_relpath,
+ svn_dirent_join(new_root_abspath, child_relpath,
+ scratch_pool),
+ this_dir,
FALSE, TRUE,
iterpool));
}
@@ -2295,7 +2341,8 @@ svn_wc__write_upgraded_entries(svn_wc__d
svn_sqlite__db_t *sdb,
apr_int64_t repos_id,
apr_int64_t wc_id,
- const char *local_abspath,
+ const char *dir_abspath,
+ const char *new_root_abspath,
apr_hash_t *entries,
apr_pool_t *scratch_pool)
{
@@ -2304,7 +2351,8 @@ svn_wc__write_upgraded_entries(svn_wc__d
ewb.db = db;
ewb.repos_id = repos_id;
ewb.wc_id = wc_id;
- ewb.local_abspath = local_abspath;
+ ewb.dir_abspath = dir_abspath;
+ ewb.new_root_abspath = new_root_abspath;
ewb.entries = entries;
/* Run this operation in a transaction to speed up SQLite.
@@ -2580,7 +2628,7 @@ svn_wc_walk_entries3(const char *path,
}
SVN_ERR(svn_wc__get_entry(&entry, db, local_abspath, FALSE,
- svn_node_file, FALSE, pool, pool));
+ svn_node_file, pool, pool));
err = walk_callbacks->found_entry(path, entry, walk_baton, pool);
if (err)
@@ -2600,52 +2648,3 @@ svn_wc_walk_entries3(const char *path,
svn_dirent_local_style(local_abspath, pool)),
walk_baton, pool);
}
-
-svn_error_t *
-svn_wc__temp_mark_missing_not_present(const char *local_abspath,
- svn_wc_context_t *wc_ctx,
- apr_pool_t *scratch_pool)
-{
- svn_wc__db_status_t status;
- svn_wc__db_kind_t kind;
- const char *repos_relpath, *repos_root_url, *repos_uuid;
- svn_revnum_t revision;
-
- SVN_ERR_ASSERT(svn_dirent_is_absolute(local_abspath));
- SVN_ERR(svn_wc__db_read_info(&status, &kind, &revision, &repos_relpath,
- &repos_root_url, &repos_uuid, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL,
- wc_ctx->db, local_abspath,
- scratch_pool, scratch_pool));
- if (kind == svn_wc__db_kind_dir
- && status == svn_wc__db_status_obstructed_delete)
- {
- if (!repos_relpath)
- SVN_ERR(svn_wc__db_scan_base_repos(&repos_relpath, &repos_root_url,
- &repos_uuid,
- wc_ctx->db, local_abspath,
- scratch_pool, scratch_pool));
-
- SVN_ERR(svn_wc__db_temp_op_remove_entry(wc_ctx->db, local_abspath,
- scratch_pool));
-
- if (!SVN_IS_VALID_REVNUM(revision))
- revision = 0; /* Just make one up */
-
- SVN_ERR(svn_wc__db_base_add_absent_node(wc_ctx->db, local_abspath,
- repos_relpath, repos_root_url,
- repos_uuid, revision,
- svn_wc__db_kind_dir,
- svn_wc__db_status_not_present,
- NULL, NULL, scratch_pool));
-
- return SVN_NO_ERROR;
- }
-
- return svn_error_createf(SVN_ERR_WC_PATH_FOUND, NULL,
- _("Unexpectedly found '%s': "
- "path is marked 'missing'"),
- svn_dirent_local_style(local_abspath, scratch_pool));
-}
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/entries.h
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/entries.h?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/entries.h (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/entries.h Fri Dec 10 21:23:03 2010
@@ -52,19 +52,9 @@ extern "C" {
* If you specify FILE/DIR, and the entry is *something else*, then
* SVN_ERR_NODE_UNEXPECTED_KIND will be returned.
*
- * For directory nodes, sometimes the caller may want the "stub" from the
- * parent directory. This is usually to examine the DELETED flag. When
- * this is desired, pass TRUE for NEED_PARENT_STUB. It is illegal to pass
- * TRUE if KIND == FILE.
- *
* If KIND == UNKNOWN, and you request the parent stub, and the node turns
* out to NOT be a directory, then SVN_ERR_NODE_UNEXPECTED_KIND is returned.
*
- * If KIND == UNKNOWN, and you request the actual file/dir data (by setting
- * NEED_PARENT_STUB to FALSE), and the node turns out to be a DIR (as
- * specified by the parent), but the subdirectory is NOT present (obstructed
- * or missing), then SVN_ERR_NODE_UNEXPECTED_KIND is returned.
- *
* NOTE: if SVN_ERR_NODE_UNEXPECTED_KIND is returned, then the ENTRY *IS*
* valid and may be examined. For any other error, ENTRY *IS NOT* valid.
*
@@ -81,7 +71,6 @@ svn_wc__get_entry(const svn_wc_entry_t *
const char *local_abspath,
svn_boolean_t allow_unversioned,
svn_node_kind_t kind,
- svn_boolean_t need_parent_stub,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
@@ -105,6 +94,7 @@ svn_wc__write_upgraded_entries(svn_wc__d
apr_int64_t repos_id,
apr_int64_t wc_id,
const char *dir_abspath,
+ const char *new_root_abspath,
apr_hash_t *entries,
apr_pool_t *scratch_pool);
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/lock.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/lock.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/lock.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/lock.c Fri Dec 10 21:23:03 2010
@@ -143,7 +143,6 @@ svn_wc__internal_check_wc(int *wc_format
}
}
-#ifdef SVN_WC__SINGLE_DB
if (*wc_format >= SVN_WC__WC_NG_VERSION)
{
svn_wc__db_status_t db_status;
@@ -151,10 +150,9 @@ svn_wc__internal_check_wc(int *wc_format
if (check_path)
{
- /* If a node is not a directory, it is not a working copy directory.
- This allows creating new working copies as a path below an existing
- working copy.
- */
+ /* If a node is not a directory, it is not a working copy
+ directory. This allows creating new working copies as
+ a path below an existing working copy. */
svn_node_kind_t wc_kind;
SVN_ERR(svn_io_check_path(local_abspath, &wc_kind, scratch_pool));
@@ -202,7 +200,6 @@ svn_wc__internal_check_wc(int *wc_format
break;
}
}
-#endif
return SVN_NO_ERROR;
}
@@ -636,17 +633,13 @@ close_single(svn_wc_adm_access_t *adm_ac
otherwise to FALSE (due to obstruction, missing, absence, exclusion,
or a "not-present" child).
- *OBSTRUCTED is set to TRUE when the node is not available because
- it is obstructed/missing, otherwise to FALSE.
-
- KIND and OBSTRUCTED can be NULL.
+ KIND can be NULL.
### note: this function should go away when we move to a single
### adminstrative area. */
static svn_error_t *
adm_available(svn_boolean_t *available,
svn_wc__db_kind_t *kind,
- svn_boolean_t *obstructed,
svn_wc__db_t *db,
const char *local_abspath,
apr_pool_t *scratch_pool)
@@ -662,17 +655,9 @@ adm_available(svn_boolean_t *available,
NULL, NULL, NULL,
db, local_abspath, scratch_pool, scratch_pool));
- if (obstructed)
- *obstructed = (status == svn_wc__db_status_obstructed ||
- status == svn_wc__db_status_obstructed_add ||
- status == svn_wc__db_status_obstructed_delete);
-
- *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);
return SVN_NO_ERROR;
}
@@ -721,7 +706,7 @@ do_open(svn_wc_adm_access_t **adm_access
{
const char *node_abspath;
svn_wc__db_kind_t kind;
- svn_boolean_t available, obstructed;
+ svn_boolean_t available;
const char *name = APR_ARRAY_IDX(children, i, const char *);
svn_pool_clear(iterpool);
@@ -734,7 +719,6 @@ do_open(svn_wc_adm_access_t **adm_access
SVN_ERR(adm_available(&available,
&kind,
- &obstructed,
db,
node_abspath,
scratch_pool));
@@ -754,12 +738,6 @@ do_open(svn_wc_adm_access_t **adm_access
/* node_access has been registered in DB, so we don't need
to do anything with it. */
}
- else if (obstructed)
- {
- svn_wc__db_temp_set_access(lock->db, node_abspath,
- (svn_wc_adm_access_t *)&missing,
- iterpool);
- }
}
}
svn_pool_destroy(iterpool);
@@ -1347,11 +1325,10 @@ open_anchor(svn_wc_adm_access_t **anchor
if (! t_access)
{
- svn_boolean_t available, obstructed;
+ svn_boolean_t available;
svn_wc__db_kind_t kind;
- err = adm_available(&available, &kind, &obstructed,
- db, local_abspath, pool);
+ err = adm_available(&available, &kind, db, local_abspath, pool);
if (err && err->apr_err == SVN_ERR_WC_PATH_NOT_FOUND)
svn_error_clear(err);
@@ -1360,13 +1337,6 @@ open_anchor(svn_wc_adm_access_t **anchor
svn_error_clear(svn_wc_adm_close2(p_access, pool));
return svn_error_return(err);
}
- if (obstructed && kind == svn_wc__db_kind_dir)
- {
- /* Child PATH is missing. */
- svn_wc__db_temp_set_access(db, local_abspath,
- (svn_wc_adm_access_t *)&missing,
- pool);
- }
}
*anchor_access = p_access ? p_access : t_access;
@@ -1574,94 +1544,6 @@ svn_wc__adm_get_db(const svn_wc_adm_acce
return adm_access->db;
}
-#ifndef SVN_WC__SINGLE_DB
-static svn_error_t *
-acquire_locks_recursively(svn_wc_context_t *wc_ctx,
- const char* local_abspath,
- svn_boolean_t lock_root,
- apr_pool_t *scratch_pool)
-{
- svn_wc__db_t *db = wc_ctx->db;
- const apr_array_header_t *children;
- apr_pool_t *iterpool;
- svn_error_t *err;
- int i;
- int format;
-
- iterpool = svn_pool_create(scratch_pool);
-
- SVN_ERR(svn_wc__db_read_children(&children, wc_ctx->db, local_abspath,
- scratch_pool, iterpool));
-
- /* The current lock paradigm is that each directory holds a lock for itself,
- and there are no inherited locks. In the eventual wc-ng paradigm, a
- lock on a directory, would imply a infinite-depth lock on the children.
- But since we aren't quite there yet, we do the infinite locking
- manually (and be sure to release them in svn_wc__release_write_lock(). */
-
- for (i = 0; i < children->nelts; i ++)
- {
- svn_wc__db_kind_t kind;
- const char *child_relpath = APR_ARRAY_IDX(children, i, const char *);
- const char *child_abspath;
-
- svn_pool_clear(iterpool);
- child_abspath = svn_dirent_join(local_abspath, child_relpath, iterpool);
-
- SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, child_abspath, FALSE,
- iterpool));
- if (kind == svn_wc__db_kind_dir)
- {
- err = acquire_locks_recursively(wc_ctx, child_abspath, FALSE,
- iterpool);
- if (err && err->apr_err == SVN_ERR_WC_LOCKED)
- {
- while(i >= 0)
- {
- svn_error_t *err2;
- svn_pool_clear(iterpool);
- child_relpath = APR_ARRAY_IDX(children, i, const char *);
- child_abspath = svn_dirent_join(local_abspath, child_relpath,
- iterpool);
-
- /* Don't release locks on non-directories as that will
- try to release the lock on the parent directory! */
- err2 = svn_wc__db_read_kind(&kind, wc_ctx->db, child_abspath,
- FALSE, iterpool);
-
- if (!err2 && kind == svn_wc__db_kind_dir)
- err2 = svn_wc__release_write_lock(wc_ctx, child_abspath,
- iterpool);
-
- err = svn_error_compose_create(err, err2);
- --i;
- }
- return svn_error_return(err);
- }
- }
- }
-
- if (lock_root)
- SVN_ERR(svn_wc__db_wclock_obtain(db, local_abspath, 0, FALSE, iterpool));
- else
- {
- /* We don't want to try and lock an unversioned directory that
- obstructs a versioned directory. */
- err = svn_wc__internal_check_wc(&format, wc_ctx->db, local_abspath, FALSE,
- iterpool);
-
- if (!err && format)
- SVN_ERR(svn_wc__db_wclock_obtain(wc_ctx->db, local_abspath, 0, FALSE,
- iterpool));
-
- svn_error_clear(err);
- }
- svn_pool_destroy(iterpool);
-
- return SVN_NO_ERROR;
-}
-#endif
-
svn_error_t *
svn_wc__acquire_write_lock(const char **lock_root_abspath,
svn_wc_context_t *wc_ctx,
@@ -1739,13 +1621,8 @@ svn_wc__acquire_write_lock(const char **
if (lock_root_abspath)
*lock_root_abspath = apr_pstrdup(result_pool, local_abspath);
-#ifndef SVN_WC__SINGLE_DB
- SVN_ERR(acquire_locks_recursively(wc_ctx, local_abspath, TRUE,
- scratch_pool));
-#else
SVN_ERR(svn_wc__db_wclock_obtain(wc_ctx->db, local_abspath, -1, FALSE,
scratch_pool));
-#endif
return SVN_NO_ERROR;
}
@@ -1758,27 +1635,6 @@ svn_wc__release_write_lock(svn_wc_contex
{
apr_uint64_t id;
svn_skel_t *work_item;
-#ifndef SVN_WC__SINGLE_DB
- apr_pool_t *iterpool;
- const apr_array_header_t *children;
- svn_boolean_t locked_here;
- int i;
-#endif
-
-#ifndef SVN_WC__SINGLE_DB
- SVN_ERR(svn_wc__db_wclock_owns_lock(&locked_here, wc_ctx->db, local_abspath,
- TRUE, scratch_pool));
-
- if (!locked_here)
- {
- /* Make wclock_release() check if the node should have been locked,
- like when the node is no wcroot (so can't have a multi-db lock) */
- SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, local_abspath,
- scratch_pool));
-
- return SVN_NO_ERROR;
- }
-#endif
SVN_ERR(svn_wc__db_wq_fetch(&id, &work_item, wc_ctx->db, local_abspath,
scratch_pool, scratch_pool));
@@ -1788,43 +1644,7 @@ svn_wc__release_write_lock(svn_wc_contex
return SVN_NO_ERROR;
}
-#ifndef SVN_WC__SINGLE_DB
- /* We need to recursively remove locks (see comment in
- svn_wc__acquire_write_lock(). */
-
- iterpool = svn_pool_create(scratch_pool);
-
- SVN_ERR(svn_wc__db_read_children(&children, wc_ctx->db, local_abspath,
- scratch_pool, iterpool));
- for (i = 0; i < children->nelts; i ++)
- {
- const char *child_relpath = APR_ARRAY_IDX(children, i, const char *);
- const char *child_abspath;
- svn_wc__db_kind_t kind;
-
- svn_pool_clear(iterpool);
- child_abspath = svn_dirent_join(local_abspath, child_relpath, iterpool);
-
- SVN_ERR(svn_wc__db_read_kind(&kind, wc_ctx->db, child_abspath, FALSE,
- iterpool));
- if (kind == svn_wc__db_kind_dir)
- {
- svn_error_t *err = svn_wc__release_write_lock(wc_ctx, child_abspath, iterpool);
-
- if (err && err->apr_err == SVN_ERR_WC_NOT_LOCKED)
- svn_error_clear(err);
- else
- SVN_ERR(err);
- }
- }
-
- SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, local_abspath, iterpool));
-
- svn_pool_destroy(iterpool);
-
-#else
SVN_ERR(svn_wc__db_wclock_release(wc_ctx->db, local_abspath, scratch_pool));
-#endif
return SVN_NO_ERROR;
}
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/node.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/node.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/node.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/node.c Fri Dec 10 21:23:03 2010
@@ -134,9 +134,7 @@ svn_wc__node_get_repos_info(const char *
return SVN_NO_ERROR;
}
- if (scan_added
- && (status == svn_wc__db_status_added
- || status == svn_wc__db_status_obstructed_add))
+ if (scan_added && (status == svn_wc__db_status_added))
{
/* We have an addition. scan_addition() will find the intended
repository location by scanning up the tree. */
@@ -153,12 +151,10 @@ 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))))
+ || (scan_deleted && (status == svn_wc__db_status_deleted))))
{
SVN_ERR(svn_wc__db_scan_base_repos(NULL, repos_root_url, repos_uuid,
wc_ctx->db, local_abspath,
@@ -363,9 +359,7 @@ svn_wc__internal_node_get_url(const char
else if (status == svn_wc__db_status_absent
|| status == svn_wc__db_status_excluded
|| status == svn_wc__db_status_not_present
- || (!have_base
- && (status == svn_wc__db_status_deleted
- || status == svn_wc__db_status_obstructed_delete)))
+ || (!have_base && (status == svn_wc__db_status_deleted)))
{
const char *parent_abspath;
@@ -444,9 +438,7 @@ svn_wc__node_get_repos_relpath(const cha
result_pool, scratch_pool));
}
else if (status == svn_wc__db_status_excluded
- || (!have_base
- && (status == svn_wc__db_status_deleted
- || status == svn_wc__db_status_obstructed_delete)))
+ || (!have_base && (status == svn_wc__db_status_deleted)))
{
const char *parent_abspath, *name, *parent_relpath;
@@ -566,8 +558,7 @@ svn_wc__internal_get_copyfrom_info(const
*is_copy_target = TRUE;
}
}
- else if ((status == svn_wc__db_status_added
- || status == svn_wc__db_status_obstructed_add)
+ else if ((status == svn_wc__db_status_added)
&& (copyfrom_rev || copyfrom_url || copyfrom_root_url
|| copyfrom_repos_relpath))
{
@@ -813,31 +804,7 @@ 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);
-
- return SVN_NO_ERROR;
-}
-
-svn_error_t *
-svn_wc__node_is_status_obstructed(svn_boolean_t *is_obstructed,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- apr_pool_t *scratch_pool)
-{
- svn_wc__db_status_t status;
-
- SVN_ERR(svn_wc__db_read_info(&status,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL, NULL, NULL, NULL, NULL, NULL,
- NULL, NULL,
- wc_ctx->db, local_abspath,
- scratch_pool, scratch_pool));
-
- *is_obstructed = (status == svn_wc__db_status_obstructed) ||
- (status == svn_wc__db_status_obstructed_add) ||
- (status == svn_wc__db_status_obstructed_delete);
+ *is_deleted = (status == svn_wc__db_status_deleted);
return SVN_NO_ERROR;
}
@@ -897,8 +864,7 @@ svn_wc__node_is_added(svn_boolean_t *is_
NULL, NULL,
wc_ctx->db, local_abspath,
scratch_pool, scratch_pool));
- *is_added = (status == svn_wc__db_status_added
- || status == svn_wc__db_status_obstructed_add);
+ *is_added = (status == svn_wc__db_status_added);
return SVN_NO_ERROR;
}
@@ -933,8 +899,7 @@ svn_wc__internal_is_replaced(svn_boolean
db, local_abspath,
scratch_pool, scratch_pool));
- *replaced = ((status == svn_wc__db_status_added
- || status == svn_wc__db_status_obstructed_add)
+ *replaced = ((status == svn_wc__db_status_added)
&& have_base
&& base_status != svn_wc__db_status_not_present);
@@ -1128,8 +1093,7 @@ svn_wc__node_get_commit_base_rev(svn_rev
wc_ctx->db, parent_abspath,
scratch_pool, scratch_pool));
- SVN_ERR_ASSERT(parent_status == svn_wc__db_status_added
- || parent_status == svn_wc__db_status_obstructed_add);
+ SVN_ERR_ASSERT(parent_status == svn_wc__db_status_added);
SVN_ERR(svn_wc__db_scan_addition(NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL,
@@ -1245,27 +1209,6 @@ svn_wc__node_check_conflicts(svn_boolean
}
svn_error_t *
-svn_wc__temp_get_keep_local(svn_boolean_t *keep_local,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- apr_pool_t *scratch_pool)
-{
-#ifndef SVN_WC__SINGLE_DB
- svn_boolean_t is_deleted;
-
- SVN_ERR(svn_wc__node_is_status_deleted(&is_deleted, wc_ctx, local_abspath,
- scratch_pool));
- if (is_deleted)
- SVN_ERR(svn_wc__db_temp_determine_keep_local(keep_local, wc_ctx->db,
- local_abspath, scratch_pool));
- else
-#endif
- *keep_local = FALSE;
-
- return SVN_NO_ERROR;
-}
-
-svn_error_t *
svn_wc__internal_node_get_schedule(svn_wc_schedule_t *schedule,
svn_boolean_t *copied,
svn_wc__db_t *db,
@@ -1299,11 +1242,9 @@ svn_wc__internal_node_get_schedule(svn_w
case svn_wc__db_status_normal:
case svn_wc__db_status_incomplete:
- case svn_wc__db_status_obstructed:
break;
case svn_wc__db_status_deleted:
- case svn_wc__db_status_obstructed_delete:
{
const char *work_del_abspath;
@@ -1332,7 +1273,6 @@ svn_wc__internal_node_get_schedule(svn_w
break;
}
case svn_wc__db_status_added:
- case svn_wc__db_status_obstructed_add:
{
const char *op_root_abspath;
const char *parent_abspath;
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/old-and-busted.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/old-and-busted.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/old-and-busted.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/old-and-busted.c Fri Dec 10 21:23:03 2010
@@ -164,7 +164,7 @@ read_str(const char **result,
svn_stringbuf_appendbytes(s, start, *buf - start);
(*buf)++;
SVN_ERR(read_escaped(&c, buf, end));
- svn_stringbuf_appendbytes(s, &c, 1);
+ svn_stringbuf_appendbyte(s, c);
start = *buf;
}
else
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/props.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/props.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/props.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/props.c Fri Dec 10 21:23:03 2010
@@ -68,34 +68,6 @@ message_from_skel(const svn_skel_t *skel
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-static svn_error_t *
-load_pristine_props(apr_hash_t **props,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- SVN_ERR(svn_wc__db_read_pristine_props(props, db, local_abspath,
- result_pool, scratch_pool));
-
- return SVN_NO_ERROR;
-}
-
-
-static svn_error_t *
-load_actual_props(apr_hash_t **props,
- svn_wc__db_t *db,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
-{
- SVN_ERR(svn_wc__db_read_props(props, db, local_abspath,
- result_pool, scratch_pool));
-
- return SVN_NO_ERROR;
-}
-
-
/* Given a *SINGLE* property conflict in PROP_SKEL, generate a message
for it, and write it to STREAM, along with a trailing EOL sequence.
@@ -174,8 +146,8 @@ immediate_install_props(svn_wc__db_t *db
apr_hash_t *base_props;
/* ### no pristines should be okay. */
- SVN_ERR_W(load_pristine_props(&base_props, db, local_abspath,
- scratch_pool, scratch_pool),
+ SVN_ERR_W(svn_wc__db_read_pristine_props(&base_props, db, local_abspath,
+ scratch_pool, scratch_pool),
_("Failed to load pristine properties"));
/* Check if the props are modified. If no changes, then wipe out
@@ -1721,8 +1693,8 @@ svn_wc__get_actual_props(apr_hash_t **pr
/* ### perform some state checking. for example, locally-deleted nodes
### should not have any ACTUAL props. */
- return svn_error_return(load_actual_props(props, db, local_abspath,
- result_pool, scratch_pool));
+ return svn_error_return(svn_wc__db_read_props(props, db, local_abspath,
+ result_pool, scratch_pool));
}
@@ -1786,30 +1758,11 @@ svn_wc__get_pristine_props(apr_hash_t **
return SVN_NO_ERROR;
}
- /* The node is obstructed:
-
- - subdir is missing, obstructed by a file, or missing admin area
- - a file is obstructed by a versioned subdir (### not reported)
-
- Thus, properties are not available for this node. Returning NULL
- would indicate "not defined" for its state. For obstructions, we
- cannot *determine* whether properties should be here or not.
-
- ### it would be nice to report an obstruction, rather than simply
- ### PROPERTY_NOT_FOUND. but this is transitional until single-db. */
- if (status == svn_wc__db_status_obstructed_delete
- || status == svn_wc__db_status_obstructed
- || status == svn_wc__db_status_obstructed_add)
- return svn_error_createf(SVN_ERR_PROPERTY_NOT_FOUND, NULL,
- U_("Directory '%s' is missing on disk, so the "
- "properties are not available."),
- svn_dirent_local_style(local_abspath,
- scratch_pool));
-
/* status: normal, moved_here, copied, deleted */
/* After the above checks, these pristines should always be present. */
- return svn_error_return(load_pristine_props(props, db, local_abspath,
+ return svn_error_return(
+ svn_wc__db_read_pristine_props(props, db, local_abspath,
result_pool, scratch_pool));
}
@@ -2149,8 +2102,8 @@ svn_wc__internal_propset(svn_wc__db_t *d
/* If not, we'll set the file to read-only at commit time. */
}
- SVN_ERR_W(load_actual_props(&prophash, db, local_abspath,
- scratch_pool, scratch_pool),
+ SVN_ERR_W(svn_wc__db_read_props(&prophash, db, local_abspath,
+ scratch_pool, scratch_pool),
_("Failed to load current properties"));
/* If we're changing this file's list of expanded keywords, then
@@ -2315,7 +2268,7 @@ svn_wc_canonicalize_svn_prop(const svn_s
if (propval->data[propval->len - 1] != '\n')
{
new_value = svn_stringbuf_create_from_string(propval, pool);
- svn_stringbuf_appendbytes(new_value, "\n", 1);
+ svn_stringbuf_appendbyte(new_value, '\n');
}
/* Make sure this is a valid externals property. Do not
@@ -2438,8 +2391,8 @@ svn_wc__internal_propdiff(apr_array_head
/* ### if pristines are not defined, then should this raise an error,
### or use an empty set? */
- SVN_ERR(load_pristine_props(&baseprops, db, local_abspath,
- result_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_read_pristine_props(&baseprops, db, local_abspath,
+ result_pool, scratch_pool));
if (original_props != NULL)
*original_props = baseprops;
@@ -2453,8 +2406,8 @@ svn_wc__internal_propdiff(apr_array_head
if (baseprops == NULL)
baseprops = apr_hash_make(scratch_pool);
- SVN_ERR(load_actual_props(&actual_props, db, local_abspath,
- result_pool, scratch_pool));
+ SVN_ERR(svn_wc__db_read_props(&actual_props, db, local_abspath,
+ result_pool, scratch_pool));
/* ### be wary. certain nodes don't have ACTUAL props either. we
### may want to raise an error. or maybe that is a deletion of
### any potential pristine props? */
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/questions.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/questions.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/questions.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/questions.c Fri Dec 10 21:23:03 2010
@@ -239,7 +239,7 @@ svn_wc__internal_versioned_file_modcheck
versioned_file_abspath,
pristine_stream,
compare_textbases,
- FALSE,
+ FALSE /* verify_checksum */,
scratch_pool));
}
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/relocate.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/relocate.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/relocate.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/relocate.c Fri Dec 10 21:23:03 2010
@@ -76,7 +76,6 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
const char *local_abspath,
const char *from,
const char *to,
- svn_boolean_t recurse,
svn_wc_relocation_validator3_t validator,
void *validator_baton,
apr_pool_t *scratch_pool)
@@ -87,6 +86,35 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
const char *old_url;
const char *new_repos_root;
const char *uuid;
+ svn_boolean_t is_wc_root;
+
+ SVN_ERR(svn_wc__strictly_is_wc_root(&is_wc_root, wc_ctx, local_abspath,
+ scratch_pool));
+ if (! is_wc_root)
+ {
+ const char *wcroot_abspath;
+ svn_error_t *err;
+
+ err = svn_wc__db_get_wcroot(&wcroot_abspath, wc_ctx->db,
+ local_abspath, scratch_pool, scratch_pool);
+ if (err)
+ {
+ svn_error_clear(err);
+ return svn_error_createf(
+ SVN_ERR_WC_INVALID_OP_ON_CWD, NULL,
+ _("Cannot relocate '%s' as it is not the root of a working copy"),
+ svn_dirent_local_style(local_abspath, scratch_pool));
+ }
+ else
+ {
+ return svn_error_createf(
+ SVN_ERR_WC_INVALID_OP_ON_CWD, NULL,
+ _("Cannot relocate '%s' as it is not the root of a working copy; "
+ "try relocating '%s' instead"),
+ svn_dirent_local_style(local_abspath, scratch_pool),
+ svn_dirent_local_style(wcroot_abspath, scratch_pool));
+ }
+ }
SVN_ERR(svn_wc__db_read_info(NULL, &kind, NULL, &repos_relpath,
&old_repos_root, &uuid,
@@ -112,48 +140,7 @@ svn_wc_relocate4(svn_wc_context_t *wc_ct
SVN_ERR(validator(validator_baton, uuid, to, new_repos_root, scratch_pool));
- /* ### FIXME: This will ultimately cause the DAV cache to be
- recursively cleared, which is great in the recursive case, but
- overreaching otherwise. Granted, this only affects performance,
- 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));
-
- if (!recurse)
- {
- /* This gets sticky. We need to do the above relocation, and then
- relocate each of the children *back* to the original location. Ugh.
- */
- const apr_array_header_t *children;
- apr_pool_t *iterpool;
- int i;
-
- SVN_ERR(svn_wc__db_read_children(&children, wc_ctx->db, local_abspath,
- scratch_pool, scratch_pool));
- iterpool = svn_pool_create(scratch_pool);
- for (i = 0; i < children->nelts; i++)
- {
- const char *child = APR_ARRAY_IDX(children, i, const char *);
- const char *child_abspath;
- const char *child_from;
- const char *child_to;
-
- svn_pool_clear(iterpool);
- child_abspath = svn_dirent_join(local_abspath, child, iterpool);
-
- /* We invert the "from" and "to" because we're switching the
- children back to the original location. */
- child_from = svn_uri_join(to, child, iterpool);
- child_to = svn_uri_join(from, child, iterpool);
-
- SVN_ERR(svn_wc_relocate4(wc_ctx, child_abspath, child_from,
- child_to, TRUE, validator, validator_baton,
- iterpool));
- }
-
- svn_pool_destroy(iterpool);
- }
-
- return SVN_NO_ERROR;
+ return svn_error_return(svn_wc__db_global_relocate(wc_ctx->db, local_abspath,
+ new_repos_root,
+ scratch_pool));
}
Modified: subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/revision_status.c
URL: http://svn.apache.org/viewvc/subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/revision_status.c?rev=1044516&r1=1044515&r2=1044516&view=diff
==============================================================================
--- subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/revision_status.c (original)
+++ subversion/branches/ignore-mergeinfo/subversion/libsvn_wc/revision_status.c Fri Dec 10 21:23:03 2010
@@ -83,9 +83,7 @@ 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)
+ || status == svn_wc__db_status_deleted)
{
wb->result->modified = TRUE;
}