You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by ju...@apache.org on 2014/09/10 11:52:14 UTC
svn commit: r1623960 - in /subversion/branches/move-tracking-2/subversion:
include/private/svn_editor3.h libsvn_delta/compat3.c libsvn_ra/ra_loader.c
libsvn_repos/commit.c
Author: julianfoad
Date: Wed Sep 10 09:52:14 2014
New Revision: 1623960
URL: http://svn.apache.org/r1623960
Log:
On the 'move-tracking-2' branch: improve doc strings and parameter names.
* subversion/include/private/svn_editor3.h
(svn_editor3_put,
svn_editor3__shim_fetch_func_t,
svn_delta__ev3_from_delta_for_commit,
svn_delta__delta_from_ev3_for_commit,
svn_editor3__insert_shims):
Improve documentation. Rename params.
* subversion/libsvn_delta/compat3.c
(ev3_edit_baton,
map_to_repos_relpath,
svn_delta__delta_from_ev3_for_commit): Rename params.
* subversion/libsvn_ra/ra_loader.c
(fetch): Rename params.
* subversion/libsvn_repos/commit.c
(fetch_func): Rename params.
Modified:
subversion/branches/move-tracking-2/subversion/include/private/svn_editor3.h
subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3.c
subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c
subversion/branches/move-tracking-2/subversion/libsvn_repos/commit.c
Modified: subversion/branches/move-tracking-2/subversion/include/private/svn_editor3.h
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/include/private/svn_editor3.h?rev=1623960&r1=1623959&r2=1623960&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/include/private/svn_editor3.h (original)
+++ subversion/branches/move-tracking-2/subversion/include/private/svn_editor3.h Wed Sep 10 09:52:14 2014
@@ -845,6 +845,9 @@ svn_editor3_rm(svn_editor3_t *editor,
* Set the content to @a new_content. (The new content may be described
* in terms of a delta against another node's content.)
*
+ * The caller owns @a new_content, including any file therein, and may
+ * destroy it after this call returns.
+ *
* @note "put" MAY be sent for any node that exists in the final state.
* "put" SHOULD NOT be sent for a node that will not exist in the final
* state. "put" SHOULD NOT be sent more than once for any node-branch.
@@ -1428,21 +1431,24 @@ svn_editor3__get_debug_editor(svn_editor
* needed by the various editor shims in order to effect backwards
* compatibility.
*
- * Implementations should set @a *kind to the node kind of @a path in
- * @a base_revision.
+ * Implementations should set @a *kind to the node kind of @a repos_relpath
+ * in @a revision.
*
* Implementations should set @a *props to the hash of properties
- * associated with @a path in @a base_revision, allocating that hash
+ * associated with @a repos_relpath in @a revision, allocating that hash
* and its contents in @a result_pool.
*
* Implementations should set @a *filename to the name of a file
- * suitable for use as a delta base for @a path in @a base_revision
+ * suitable for use as a delta base for @a repos_relpath in @a revision
* (allocating @a *filename from @a result_pool), or to @c NULL if the
* base stream is empty.
*
* Any output argument may be NULL if the output is not wanted.
*
* @a baton is an implementation-specific closure.
+ * @a repos_relpath is relative to the repository root.
+ * The implementation should ensure that @a new_content, including any
+ * file therein, lives at least for the life time of @a result_pool.
* @a scratch_pool is provided for temporary allocations.
*/
typedef svn_error_t *(*svn_editor3__shim_fetch_func_t)(
@@ -1450,8 +1456,8 @@ typedef svn_error_t *(*svn_editor3__shim
apr_hash_t **props,
const char **filename,
void *baton,
- const char *path,
- svn_revnum_t base_revision,
+ const char *repos_relpath,
+ svn_revnum_t revision,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool
);
@@ -1487,15 +1493,8 @@ typedef struct svn_editor3__shim_connect
* relative path within the repository of the root directory of the edit.
* (An Ev1 edit must be rooted at a directory, not at a file.)
*
- * FETCH_KIND_FUNC / FETCH_KIND_BATON: A callback by which the shim may
- * determine the kind of a path. This is called for a copy source or move
- * source node, passing the Ev3 relpath and the specific copy-from
- * revision.
- *
- * FETCH_PROPS_FUNC / FETCH_PROPS_BATON: A callback by which the shim may
- * determine the existing properties on a path. This is called for a copy
- * source or move source node or a modified node, but not for a simple
- * add, passing the Ev3 relpath and the specific revision.
+ * FETCH_FUNC/FETCH_BATON is a callback by which the shim may retrieve the
+ * original or copy-from kind/properties/text for a path being committed.
*
* CANCEL_FUNC / CANCEL_BATON: The usual cancellation callback; folded
* into the produced editor. May be NULL/NULL if not wanted.
@@ -1510,7 +1509,7 @@ svn_delta__ev3_from_delta_for_commit(
svn_editor3__shim_connector_t **shim_connector,
const svn_delta_editor_t *deditor,
void *dedit_baton,
- const char *repos_root,
+ const char *repos_root_url,
const char *base_relpath,
svn_editor3__shim_fetch_func_t fetch_func,
void *fetch_baton,
@@ -1525,13 +1524,8 @@ svn_delta__ev3_from_delta_for_commit(
* relative path within the repository of the root directory of the edit.
* (An Ev1 edit must be rooted at a directory, not at a file.)
*
- * FETCH_PROPS_FUNC / FETCH_PROPS_BATON: A callback / baton pair which
- * will be used by the shim handlers if they need to determine the
- * existing properties on a path.
- *
- * FETCH_BASE_FUNC / FETCH_BASE_BATON: A callback / baton pair which will
- * be used by the shims handlers if they need to determine the base
- * text of a path. It should only be invoked for files.
+ * FETCH_FUNC/FETCH_BATON is a callback by which the shim may retrieve the
+ * original or copy-from kind/properties/text for a path being committed.
*
* SHIM_CONNECTOR can be used to enable a more exact round-trip conversion
* from an Ev1 drive to Ev3 and back to Ev1. It must live for the lifetime
@@ -1546,7 +1540,7 @@ svn_delta__delta_from_ev3_for_commit(
const svn_delta_editor_t **deditor,
void **dedit_baton,
svn_editor3_t *editor,
- const char *repos_root,
+ const char *repos_root_url,
const char *base_relpath,
svn_editor3__shim_fetch_func_t fetch_func,
void *fetch_baton,
@@ -1561,9 +1555,8 @@ svn_delta__delta_from_ev3_for_commit(
* REPOS_ROOT_URL is the repository root URL, and BASE_RELPATH is the
* relative path within the repository of the root directory of the edit.
*
- * FETCH_FUN/FETCH_BATON is a callback that the shims may use to fetch
- * details of the base state (that is, the initial state of the edit) when
- * needed.
+ * FETCH_FUNC/FETCH_BATON is a callback by which the shim may retrieve the
+ * original or copy-from kind/properties/text for a path being committed.
*/
svn_error_t *
svn_editor3__insert_shims(
Modified: subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3.c?rev=1623960&r1=1623959&r2=1623960&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_delta/compat3.c Wed Sep 10 09:52:14 2014
@@ -620,7 +620,7 @@ struct ev3_edit_baton
#endif
/* Repository root URL. */
- const char *repos_root;
+ const char *repos_root_url;
/* Base directory of the edit, relative to the repository root. */
const char *base_relpath;
@@ -890,7 +890,7 @@ map_to_repos_relpath(struct ev3_edit_bat
{
if (svn_path_is_url(path_or_url))
{
- return svn_uri_skip_ancestor(eb->repos_root, path_or_url, result_pool);
+ return svn_uri_skip_ancestor(eb->repos_root_url, path_or_url, result_pool);
}
else
{
@@ -1538,7 +1538,7 @@ svn_delta__delta_from_ev3_for_commit(
const svn_delta_editor_t **deditor,
void **dedit_baton,
svn_editor3_t *editor,
- const char *repos_root,
+ const char *repos_root_url,
const char *base_relpath,
svn_editor3__shim_fetch_func_t fetch_func,
void *fetch_baton,
@@ -1582,7 +1582,7 @@ svn_delta__delta_from_ev3_for_commit(
*eb->shim_connector->ev1_absolute_paths = FALSE;
#endif
}
- eb->repos_root = apr_pstrdup(result_pool, repos_root);
+ eb->repos_root_url = apr_pstrdup(result_pool, repos_root_url);
eb->base_relpath = apr_pstrdup(result_pool, base_relpath);
eb->fetch_func = fetch_func;
Modified: subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c?rev=1623960&r1=1623959&r2=1623960&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_ra/ra_loader.c Wed Sep 10 09:52:14 2014
@@ -770,14 +770,14 @@ fetch(svn_node_kind_t *kind_p,
const char **filename_p,
void *baton,
const char *repos_relpath,
- svn_revnum_t base_revision,
+ svn_revnum_t revision,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
struct fb_baton *fbb = baton;
svn_node_kind_t kind;
- SVN_ERR(svn_ra_check_path(fbb->session, repos_relpath, base_revision,
+ SVN_ERR(svn_ra_check_path(fbb->session, repos_relpath, revision,
&kind, scratch_pool));
if (kind_p)
*kind_p = kind;
@@ -792,7 +792,7 @@ fetch(svn_node_kind_t *kind_p,
svn_io_file_del_none,
scratch_pool, scratch_pool));
}
- SVN_ERR(svn_ra_get_file(fbb->session, repos_relpath, base_revision,
+ SVN_ERR(svn_ra_get_file(fbb->session, repos_relpath, revision,
file_stream, NULL, props_p, result_pool));
if (filename_p)
{
@@ -802,7 +802,7 @@ fetch(svn_node_kind_t *kind_p,
}
else if (props_p)
{
- SVN_ERR(svn_ra_get_dir(fbb->session, repos_relpath, base_revision,
+ SVN_ERR(svn_ra_get_dir(fbb->session, repos_relpath, revision,
NULL /*dirents*/, NULL, props_p, result_pool));
}
return SVN_NO_ERROR;
Modified: subversion/branches/move-tracking-2/subversion/libsvn_repos/commit.c
URL: http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/libsvn_repos/commit.c?rev=1623960&r1=1623959&r2=1623960&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/libsvn_repos/commit.c (original)
+++ subversion/branches/move-tracking-2/subversion/libsvn_repos/commit.c Wed Sep 10 09:52:14 2014
@@ -842,8 +842,8 @@ fetch_func(svn_node_kind_t *kind,
apr_hash_t **props,
const char **filename,
void *baton,
- const char *path,
- svn_revnum_t base_revision,
+ const char *repos_relpath,
+ svn_revnum_t revision,
apr_pool_t *result_pool,
apr_pool_t *scratch_pool)
{
@@ -851,19 +851,19 @@ fetch_func(svn_node_kind_t *kind,
svn_fs_root_t *fs_root;
svn_error_t *err;
- if (!SVN_IS_VALID_REVNUM(base_revision))
- base_revision = svn_fs_txn_base_revision(eb->txn);
+ if (!SVN_IS_VALID_REVNUM(revision))
+ revision = svn_fs_txn_base_revision(eb->txn);
- SVN_ERR(svn_fs_revision_root(&fs_root, eb->fs, base_revision, scratch_pool));
+ SVN_ERR(svn_fs_revision_root(&fs_root, eb->fs, revision, scratch_pool));
if (kind)
{
- SVN_ERR(svn_fs_check_path(kind, fs_root, path, scratch_pool));
+ SVN_ERR(svn_fs_check_path(kind, fs_root, repos_relpath, scratch_pool));
}
if (props)
{
- err = svn_fs_node_proplist(props, fs_root, path, result_pool);
+ err = svn_fs_node_proplist(props, fs_root, repos_relpath, result_pool);
if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND)
{
svn_error_clear(err);
@@ -880,7 +880,7 @@ fetch_func(svn_node_kind_t *kind,
svn_stream_t *file_stream;
const char *tmp_filename;
- err = svn_fs_file_contents(&contents, fs_root, path, scratch_pool);
+ err = svn_fs_file_contents(&contents, fs_root, repos_relpath, scratch_pool);
if (err && err->apr_err == SVN_ERR_FS_NOT_FOUND)
{
svn_error_clear(err);