Author: hwright
Date: Fri Jan 13 20:05:32 2012
New Revision: 1231279
URL: http://svn.apache.org/viewvc?rev=1231279&view=rev
Log:
Ev2 shims: Fetch the correct node kind when performing a copy.
Current number of Ev2 test failures: 56
* subversion/include/svn_delta.h
(svn_delta_fetch_kind_func_t): Add a base revision param.
* subversion/libsvn_wc/util.c
(svn_wc__fetch_kind_func): Same.
* subversion/libsvn_wc/wc.h
(svn_wc__fetch_kind_func): Same.
* subversion/libsvn_client/repos_diff.c
(fetch_kind_func): Same.
* subversion/libsvn_client/export.c
(fetch_kind_func): Same.
* subversion/libsvn_repos/commit.c
(kind_fetch_func): Use the base revision to find the correct kind.
* subversion/libsvn_repos/dump.c
(edit_baton): Add an FS member.
(fetch_kind_func): Find the correct kind.
(fetch_base_func): Look at the right base, given the base_revision.
(get_dump_editor): Populate FS baton member.
* subversion/libsvn_delta/compat.c
(build): Provide the base revision, and in the case of copy, use the
copyfrom url to fetch the kind.
Modified:
subversion/trunk/subversion/include/svn_delta.h
subversion/trunk/subversion/libsvn_client/export.c
subversion/trunk/subversion/libsvn_client/repos_diff.c
subversion/trunk/subversion/libsvn_delta/compat.c
subversion/trunk/subversion/libsvn_repos/commit.c
subversion/trunk/subversion/libsvn_repos/dump.c
subversion/trunk/subversion/libsvn_wc/util.c
subversion/trunk/subversion/libsvn_wc/wc.h
Modified: subversion/trunk/subversion/include/svn_delta.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_delta.h?rev=1231279&r1=1231278&r2=1231279&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_delta.h (original)
+++ subversion/trunk/subversion/include/svn_delta.h Fri Jan 13 20:05:32 2012
@@ -1111,6 +1111,7 @@ typedef svn_error_t *(*svn_delta_fetch_k
svn_kind_t *kind,
void *baton,
const char *path,
+ svn_revnum_t base_revision,
apr_pool_t *scratch_pool
);
Modified: subversion/trunk/subversion/libsvn_client/export.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/export.c?rev=1231279&r1=1231278&r2=1231279&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/export.c (original)
+++ subversion/trunk/subversion/libsvn_client/export.c Fri Jan 13 20:05:32 2012
@@ -1024,6 +1024,7 @@ static svn_error_t *
fetch_kind_func(svn_kind_t *kind,
void *baton,
const char *path,
+ svn_revnum_t base_revision,
apr_pool_t *scratch_pool)
{
/* We know the root of the edit is a directory. */
Modified: subversion/trunk/subversion/libsvn_client/repos_diff.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/repos_diff.c?rev=1231279&r1=1231278&r2=1231279&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/repos_diff.c (original)
+++ subversion/trunk/subversion/libsvn_client/repos_diff.c Fri Jan 13 20:05:32
2012
@@ -1311,6 +1311,7 @@ static svn_error_t *
fetch_kind_func(svn_kind_t *kind,
void *baton,
const char *path,
+ svn_revnum_t base_revision,
apr_pool_t *scratch_pool)
{
struct edit_baton *eb = baton;
Modified: subversion/trunk/subversion/libsvn_delta/compat.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_delta/compat.c?rev=1231279&r1=1231278&r2=1231279&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_delta/compat.c (original)
+++ subversion/trunk/subversion/libsvn_delta/compat.c Fri Jan 13 20:05:32 2012
@@ -988,7 +988,7 @@ build(struct editor_baton *eb,
if (kind == svn_kind_unknown)
SVN_ERR(eb->fetch_kind_func(&operation->kind, eb->fetch_kind_baton,
- relpath, scratch_pool));
+ relpath, rev, scratch_pool));
else
operation->kind = kind;
@@ -1035,9 +1035,9 @@ build(struct editor_baton *eb,
operation->operation =
operation->operation == OP_DELETE ? OP_REPLACE : OP_ADD;
- if (kind == svn_kind_none)
+ if (kind == svn_kind_none || kind == svn_kind_unknown)
SVN_ERR(eb->fetch_kind_func(&operation->kind, eb->fetch_kind_baton,
- relpath, scratch_pool));
+ url, rev, scratch_pool));
else
operation->kind = kind;
operation->copyfrom_url = url;
Modified: subversion/trunk/subversion/libsvn_repos/commit.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/commit.c?rev=1231279&r1=1231278&r2=1231279&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/commit.c (original)
+++ subversion/trunk/subversion/libsvn_repos/commit.c Fri Jan 13 20:05:32 2012
@@ -818,14 +818,27 @@ static svn_error_t *
kind_fetch_func(svn_kind_t *kind,
void *baton,
const char *path,
+ svn_revnum_t base_revision,
apr_pool_t *scratch_pool)
{
struct edit_baton *eb = baton;
svn_node_kind_t node_kind;
- if (path[0] != '/')
- /* Get an absolute path for use in the FS. */
- path = svn_fspath__join(eb->base_path, path, scratch_pool);
+ if (!SVN_IS_VALID_REVNUM(base_revision))
+ base_revision = svn_fs_txn_base_revision(eb->txn);
+
+ if (svn_path_is_url(path))
+ {
+ /* This is a copyfrom URL. */
+ path = svn_uri_skip_ancestor(eb->repos_url, path, scratch_pool);
+ }
+ else
+ {
+ /* This is a base-relative path. */
+ if (path[0] != '/')
+ /* Get an absolute path for use in the FS. */
+ path = svn_fspath__join(eb->base_path, path, scratch_pool);
+ }
SVN_ERR(svn_fs_check_path(&node_kind, eb->txn_root, path, scratch_pool));
*kind = svn__kind_from_node_kind(node_kind, FALSE);
Modified: subversion/trunk/subversion/libsvn_repos/dump.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/dump.c?rev=1231279&r1=1231278&r2=1231279&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_repos/dump.c (original)
+++ subversion/trunk/subversion/libsvn_repos/dump.c Fri Jan 13 20:05:32 2012
@@ -105,6 +105,9 @@ struct edit_baton
svn_fs_root_t *fs_root;
svn_revnum_t current_rev;
+ /* The fs, so we can grab historic information if needed. */
+ svn_fs_t *fs;
+
/* True if dumped nodes should output deltas instead of full text. */
svn_boolean_t use_deltas;
@@ -879,12 +882,20 @@ static svn_error_t *
fetch_kind_func(svn_kind_t *kind,
void *baton,
const char *path,
+ svn_revnum_t base_revision,
apr_pool_t *scratch_pool)
{
struct edit_baton *eb = baton;
svn_node_kind_t node_kind;
+ svn_fs_root_t *fs_root;
+
+ if (!SVN_IS_VALID_REVNUM(base_revision))
+ fs_root = eb->fs_root;
+ else
+ SVN_ERR(svn_fs_revision_root(&fs_root, eb->fs, base_revision,
+ scratch_pool));
- SVN_ERR(svn_fs_check_path(&node_kind, eb->fs_root, path, scratch_pool));
+ SVN_ERR(svn_fs_check_path(&node_kind, fs_root, path, scratch_pool));
*kind = svn__kind_from_node_kind(node_kind, FALSE);
return SVN_NO_ERROR;
@@ -903,8 +914,15 @@ fetch_base_func(const char **filename,
svn_stream_t *file_stream;
const char *tmp_filename;
svn_error_t *err;
+ svn_fs_root_t *fs_root;
+
+ if (!SVN_IS_VALID_REVNUM(base_revision))
+ fs_root = eb->fs_root;
+ else
+ SVN_ERR(svn_fs_revision_root(&fs_root, eb->fs, base_revision,
+ scratch_pool));
- err = svn_fs_file_contents(&contents, eb->fs_root, path, scratch_pool);
+ err = svn_fs_file_contents(&contents, fs_root, path, scratch_pool);
if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND)
{
svn_error_clear(err);
@@ -958,6 +976,7 @@ get_dump_editor(const svn_delta_editor_t
eb->bufsize = sizeof(eb->buffer);
eb->path = apr_pstrdup(pool, root_path);
SVN_ERR(svn_fs_revision_root(&(eb->fs_root), fs, to_rev, pool));
+ eb->fs = fs;
eb->current_rev = to_rev;
eb->use_deltas = use_deltas;
eb->verify = verify;
Modified: subversion/trunk/subversion/libsvn_wc/util.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/util.c?rev=1231279&r1=1231278&r2=1231279&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/util.c (original)
+++ subversion/trunk/subversion/libsvn_wc/util.c Fri Jan 13 20:05:32 2012
@@ -539,6 +539,7 @@ svn_error_t *
svn_wc__fetch_kind_func(svn_kind_t *kind,
void *baton,
const char *path,
+ svn_revnum_t base_revision,
apr_pool_t *scratch_pool)
{
struct svn_wc__shim_fetch_baton_t *sfb = baton;
Modified: subversion/trunk/subversion/libsvn_wc/wc.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wc.h?rev=1231279&r1=1231278&r2=1231279&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wc.h (original)
+++ subversion/trunk/subversion/libsvn_wc/wc.h Fri Jan 13 20:05:32 2012
@@ -739,6 +739,7 @@ svn_error_t *
svn_wc__fetch_kind_func(svn_kind_t *kind,
void *baton,
const char *path,
+ svn_revnum_t base_revision,
apr_pool_t *scratch_pool);
/* Using a BATON of struct shim_fetch_baton, return PROPS for PATH. */