Author: julianfoad
Date: Tue Feb 19 17:02:25 2019
New Revision: 1853898
URL: http://svn.apache.org/viewvc?rev=1853898&view=rev
Log:
Change the shelf storage directory name from 'v2' to 'v3'.
Also remove the knowledge of the existence of a shelves directory from the
WC API, and instead just have knowledge of the 'experimental' features dir
at this level.
* subversion/include/private/svn_wc_private.h,
subversion/libsvn_wc/wcroot_anchor.c
(svn_wc__get_experimental_dir): Replacement for 'svn_wc__get_shelves_dir'.
* subversion/libsvn_client/shelf.c
(get_shelves_dir): New.
(shelf_construct,
svn_client__shelf_list): Use it.
Modified:
subversion/trunk/subversion/include/private/svn_wc_private.h
subversion/trunk/subversion/libsvn_client/shelf.c
subversion/trunk/subversion/libsvn_wc/wcroot_anchor.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=1853898&r1=1853897&r2=1853898&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_wc_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_wc_private.h Tue Feb 19
17:02:25 2019
@@ -348,9 +348,9 @@ svn_wc__get_wcroot(const char **wcroot_a
apr_pool_t *result_pool,
apr_pool_t *scratch_pool);
-/** Set @a *dir to the abspath of the directory in which shelved patches
- * are stored, which is inside the WC's administrative directory, and ensure
- * the directory exists.
+/** Set @a *dir to the abspath of the directory in which administrative
+ * data for experimental features may be stored. This directory is inside
+ * the WC's administrative directory. Ensure the directory exists.
*
* @a local_abspath is any path in the WC, and is used to find the WC root.
*
@@ -358,11 +358,11 @@ svn_wc__get_wcroot(const char **wcroot_a
*/
SVN_EXPERIMENTAL
svn_error_t *
-svn_wc__get_shelves_dir(char **dir,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool);
+svn_wc__get_experimental_dir(char **dir,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool);
/**
* The following are temporary APIs to aid in the transition from wc-1 to
Modified: subversion/trunk/subversion/libsvn_client/shelf.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/shelf.c?rev=1853898&r1=1853897&r2=1853898&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/shelf.c (original)
+++ subversion/trunk/subversion/libsvn_client/shelf.c Tue Feb 19 17:02:25 2019
@@ -114,6 +114,28 @@ shelf_name_from_filename(char **name,
return SVN_NO_ERROR;
}
+/* Set *DIR to the shelf storage directory inside the WC's administrative
+ * area. Ensure the directory exists. */
+static svn_error_t *
+get_shelves_dir(char **dir,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
+{
+ char *experimental_abspath;
+
+ SVN_ERR(svn_wc__get_experimental_dir(&experimental_abspath,
+ wc_ctx, local_abspath,
+ scratch_pool, scratch_pool));
+ *dir = svn_dirent_join(experimental_abspath, "shelves/v3", result_pool);
+
+ /* Ensure the directory exists. (Other versions of svn don't create it.) */
+ SVN_ERR(svn_io_make_dir_recursively(*dir, scratch_pool));
+
+ return SVN_NO_ERROR;
+}
+
/* Set *ABSPATH to the abspath of the file storage dir for SHELF
* version VERSION, no matter whether it exists.
*/
@@ -1175,9 +1197,8 @@ shelf_construct(svn_client__shelf_t **sh
SVN_ERR(svn_client_get_wc_root(&shelf->wc_root_abspath,
local_abspath, ctx,
result_pool, result_pool));
- SVN_ERR(svn_wc__get_shelves_dir(&shelves_dir,
- ctx->wc_ctx, local_abspath,
- result_pool, result_pool));
+ SVN_ERR(get_shelves_dir(&shelves_dir, ctx->wc_ctx, local_abspath,
+ result_pool, result_pool));
shelf->shelves_dir = shelves_dir;
shelf->ctx = ctx;
shelf->pool = result_pool;
@@ -2119,8 +2140,8 @@ svn_client__shelf_list(apr_hash_t **shel
SVN_ERR(svn_wc__get_wcroot(&wc_root_abspath, ctx->wc_ctx, local_abspath,
scratch_pool, scratch_pool));
- SVN_ERR(svn_wc__get_shelves_dir(&shelves_dir, ctx->wc_ctx, local_abspath,
- scratch_pool, scratch_pool));
+ SVN_ERR(get_shelves_dir(&shelves_dir, ctx->wc_ctx, local_abspath,
+ scratch_pool, scratch_pool));
SVN_ERR(svn_io_get_dirents3(&dirents, shelves_dir, FALSE /*only_check_type*/,
result_pool, scratch_pool));
Modified: subversion/trunk/subversion/libsvn_wc/wcroot_anchor.c
URL:
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_wc/wcroot_anchor.c?rev=1853898&r1=1853897&r2=1853898&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_wc/wcroot_anchor.c (original)
+++ subversion/trunk/subversion/libsvn_wc/wcroot_anchor.c Tue Feb 19 17:02:25
2019
@@ -183,21 +183,20 @@ svn_wc__get_wcroot(const char **wcroot_a
svn_error_t *
-svn_wc__get_shelves_dir(char **dir,
- svn_wc_context_t *wc_ctx,
- const char *local_abspath,
- apr_pool_t *result_pool,
- apr_pool_t *scratch_pool)
+svn_wc__get_experimental_dir(char **dir,
+ svn_wc_context_t *wc_ctx,
+ const char *local_abspath,
+ apr_pool_t *result_pool,
+ apr_pool_t *scratch_pool)
{
const char *wcroot_abspath;
SVN_ERR(svn_wc__get_wcroot(&wcroot_abspath, wc_ctx, local_abspath,
scratch_pool, scratch_pool));
*dir = svn_dirent_join(wcroot_abspath,
- SVN_WC_ADM_DIR_NAME "/" SVN_WC__ADM_EXPERIMENTAL "/"
- "shelves/v2",
+ SVN_WC_ADM_DIR_NAME "/" SVN_WC__ADM_EXPERIMENTAL,
result_pool);
-
+
/* Ensure the directory exists. (Other versions of svn don't create it.) */
SVN_ERR(svn_io_make_dir_recursively(*dir, scratch_pool));