Author: rhuijben
Date: Mon Jun 28 13:47:14 2010
New Revision: 958578
URL: http://svn.apache.org/viewvc?rev=958578&view=rev
Log:
Pull the svn_wc_register_file_external api from the public api, to make sure
that we review this function and its use cases before making it part of the
public 1.7 api.
* subversion/include/private/svn_wc_private.h
(svn_wc__register_file_external): Add function here, that used to be...
* subversion/include/svn_wc.h
(svn_wc_register_file_external): Here.
* subversion/libsvn_client/externals.c
(switch_file_external): Update caller.
* subversion/libsvn_wc/adm_ops.c
(svn_wc_register_file_external): Rename function from this to ...
(svn_wc__register_file_external): ... this and use a db_op to install a
new working node. Which then later will be converted to a base node
in the next update.
Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/include/svn_wc.h
subversion/trunk/subversion/libsvn_client/externals.c
subversion/trunk/subversion/libsvn_wc/adm_ops.c
Modified: subversion/trunk/subversion/include/private/svn_wc_private.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_wc_private.h?rev=958578&r1=958577&r2=958578&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Mon Jun 28
13:47:14 2010
@@ -713,6 +713,23 @@ svn_wc__temp_get_keep_local(svn_boolean_
const char *local_abspath,
apr_pool_t *scratch_pool);
+/**
+ * Register @a local_abspath as a new file external aimed at
+ * @a external_url, @a external_peg_rev, and @a external_rev.
+ *
+ * If not @c NULL, @a external_peg_rev and @a external_rev must each
+ * be of kind @c svn_opt_revision_number or @c svn_opt_revision_head.
+ *
+ * @since New in 1.7.
+ */
+svn_error_t *
+svn_wc__register_file_external(svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ const char *external_url,
+ const svn_opt_revision_t *external_peg_rev,
+ const svn_opt_revision_t *external_rev,
+ apr_pool_t *scratch_pool);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
Modified: subversion/trunk/subversion/include/svn_wc.h
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc.h?rev=958578&r1=958577&r2=958578&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_wc.h (original)
+++ subversion/trunk/subversion/include/svn_wc.h Mon Jun 28 13:47:14 2010
@@ -4379,23 +4379,6 @@ svn_wc_delete(const char *path,
apr_pool_t *pool);
/**
- * Register @a local_abspath as a new file external aimed at
- * @a external_url, @a external_peg_rev, and @a external_rev.
- *
- * If not @c NULL, @a external_peg_rev and @a external_rev must each
- * be of kind @c svn_opt_revision_number or @c svn_opt_revision_head.
- *
- * @since New in 1.7.
- */
-svn_error_t *
-svn_wc_register_file_external(svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- const char *external_url,
- const svn_opt_revision_t *external_peg_rev,
- const svn_opt_revision_t *external_rev,
- apr_pool_t *scratch_pool);
-
-/**
* Put @a local_abspath under version control by registering it as addition
* or copy in the database containing its parent. The new node is scheduled
* for addition to the repository below its parent node.
Modified: subversion/trunk/subversion/libsvn_client/externals.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/externals.c?rev=958578&r1=958577&r2=958578&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/externals.c (original)
+++ subversion/trunk/subversion/libsvn_client/externals.c Mon Jun 28 13:47:14
2010
@@ -439,8 +439,8 @@ switch_file_external(const char *path,
if (err)
goto cleanup;
- err = svn_wc_register_file_external(ctx->wc_ctx, local_abspath, url,
- peg_revision, revision, subpool);
+ err = svn_wc__register_file_external(ctx->wc_ctx, local_abspath, url,
+ peg_revision, revision, subpool);
if (err)
goto cleanup;
}
Modified: subversion/trunk/subversion/libsvn_wc/adm_ops.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/adm_ops.c?rev=958578&r1=958577&r2=958578&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/adm_ops.c (original)
+++ subversion/trunk/subversion/libsvn_wc/adm_ops.c Mon Jun 28 13:47:14 2010
@@ -1530,24 +1530,24 @@ svn_wc_add4(svn_wc_context_t *wc_ctx,
}
svn_error_t *
-svn_wc_register_file_external(svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- const char *external_url,
- const svn_opt_revision_t *external_peg_rev,
- const svn_opt_revision_t *external_rev,
- apr_pool_t *scratch_pool)
+svn_wc__register_file_external(svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ const char *external_url,
+ const svn_opt_revision_t *external_peg_rev,
+ const svn_opt_revision_t *external_rev,
+ apr_pool_t *scratch_pool)
{
svn_wc__db_t *db = wc_ctx->db;
const char *parent_abspath, *base_name, *repos_root_url;
svn_dirent_split(&parent_abspath, &base_name, local_abspath, scratch_pool);
- SVN_ERR(svn_wc_add4(wc_ctx, local_abspath, svn_depth_infinity,
- NULL, SVN_INVALID_REVNUM, NULL, NULL, NULL, NULL,
- scratch_pool));
SVN_ERR(svn_wc__db_scan_base_repos(NULL, &repos_root_url, NULL, db,
parent_abspath, scratch_pool,
scratch_pool));
+
+ SVN_ERR(svn_wc__db_op_add_file(wc_ctx->db, local_abspath, NULL,
scratch_pool));
+
SVN_ERR(svn_wc__set_file_external_location(wc_ctx, local_abspath,
external_url, external_peg_rev,
external_rev, repos_root_url,