Author: julianfoad
Date: Thu Feb 22 11:49:58 2018
New Revision: 1825049

URL: http://svn.apache.org/viewvc?rev=1825049&view=rev
Log:
Shelving: clarify the API a little.

* subversion/include/svn_client.h,
  subversion/libsvn_client/shelf.c
  (svn_client_shelf_open_or_create): Rename from svn_client_shelf_open().
  Improve documentation in several shelving APIs.

* subversion/svn/shelf-cmd.c
  (shelve): Track the rename.

Modified:
    subversion/trunk/subversion/include/svn_client.h
    subversion/trunk/subversion/libsvn_client/shelf.c
    subversion/trunk/subversion/svn/shelf-cmd.c

Modified: subversion/trunk/subversion/include/svn_client.h
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_client.h?rev=1825049&r1=1825048&r2=1825049&view=diff
==============================================================================
--- subversion/trunk/subversion/include/svn_client.h (original)
+++ subversion/trunk/subversion/include/svn_client.h Thu Feb 22 11:49:58 2018
@@ -6855,23 +6855,30 @@ typedef struct svn_client_shelf_version_
 
 /** Open an existing shelf or create a new shelf.
  *
+ * Create a new shelf (containing no versions) if a shelf named @a name
+ * is not found.
+ *
  * The shelf should be closed after use by calling svn_client_shelf_close().
  *
+ * @a local_abspath is any path in the WC and is used to find the WC root.
+ *
  * @since New in 1.X.
  * @warning EXPERIMENTAL.
  */
 SVN_EXPERIMENTAL
 svn_error_t *
-svn_client_shelf_open(svn_client_shelf_t **shelf_p,
-                      const char *name,
-                      const char *local_abspath,
-                      svn_client_ctx_t *ctx,
-                      apr_pool_t *result_pool);
+svn_client_shelf_open_or_create(svn_client_shelf_t **shelf_p,
+                                const char *name,
+                                const char *local_abspath,
+                                svn_client_ctx_t *ctx,
+                                apr_pool_t *result_pool);
 
-/** Open an existing shelf or error if it doesn't exist.
+/** Open an existing shelf named @a name, or error if it doesn't exist.
  *
  * The shelf should be closed after use by calling svn_client_shelf_close().
  *
+ * @a local_abspath is any path in the WC and is used to find the WC root.
+ *
  * @since New in 1.X.
  * @warning EXPERIMENTAL.
  */
@@ -6895,7 +6902,9 @@ svn_error_t *
 svn_client_shelf_close(svn_client_shelf_t *shelf,
                        apr_pool_t *scratch_pool);
 
-/** Delete a shelf, by name.
+/** Delete the shelf named @a name, or error if it doesn't exist.
+ *
+ * @a local_abspath is any path in the WC and is used to find the WC root.
  *
  * @since New in 1.X.
  * @warning EXPERIMENTAL.
@@ -6914,7 +6923,8 @@ svn_client_shelf_delete(const char *name
  * @a paths are relative to the CWD, or absolute.
  *
  * If there are no local modifications in the specified locations, do not
- * create a new version of @a shelf.
+ * create a new version of @a shelf, and return SVN_NO_ERROR. In this case
+ * @a shelf->max_version after the call is the same as before the call.
  *
  * @since New in 1.X.
  * @warning EXPERIMENTAL.
@@ -7166,6 +7176,8 @@ svn_client_shelves_list(apr_hash_t **she
  * the new path, both relative to the WC root. The key and value are the
  * same except when a path is moved or copied.
  *
+ * @a local_abspath is any path in the WC and is used to find the WC root.
+ *
  * @since New in 1.10.
  * @warning EXPERIMENTAL.
  */
@@ -7182,6 +7194,8 @@ svn_client_shelf_get_paths(apr_hash_t **
  * contains any modifications, in other words if svn_client_shelf_get_paths()
  * would return a non-empty set of paths.
  *
+ * @a local_abspath is any path in the WC and is used to find the WC root.
+ *
  * @since New in 1.10.
  * @warning EXPERIMENTAL.
  */

Modified: subversion/trunk/subversion/libsvn_client/shelf.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_client/shelf.c?rev=1825049&r1=1825048&r2=1825049&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_client/shelf.c (original)
+++ subversion/trunk/subversion/libsvn_client/shelf.c Thu Feb 22 11:49:58 2018
@@ -446,11 +446,11 @@ svn_client_shelf_open_existing(svn_clien
 }
 
 svn_error_t *
-svn_client_shelf_open(svn_client_shelf_t **shelf_p,
-                      const char *name,
-                      const char *local_abspath,
-                      svn_client_ctx_t *ctx,
-                      apr_pool_t *result_pool)
+svn_client_shelf_open_or_create(svn_client_shelf_t **shelf_p,
+                                const char *name,
+                                const char *local_abspath,
+                                svn_client_ctx_t *ctx,
+                                apr_pool_t *result_pool)
 {
   SVN_ERR(shelf_construct(shelf_p, name,
                           local_abspath, ctx, result_pool));

Modified: subversion/trunk/subversion/svn/shelf-cmd.c
URL: 
http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/shelf-cmd.c?rev=1825049&r1=1825048&r2=1825049&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/shelf-cmd.c (original)
+++ subversion/trunk/subversion/svn/shelf-cmd.c Thu Feb 22 11:49:58 2018
@@ -456,8 +456,9 @@ shelve(int *new_version_p,
   const char *cwd_abspath;
   struct status_baton sb;
 
-  SVN_ERR(svn_client_shelf_open(&shelf,
-                                name, local_abspath, ctx, scratch_pool));
+  SVN_ERR(svn_client_shelf_open_or_create(&shelf,
+                                          name, local_abspath,
+                                          ctx, scratch_pool));
   previous_version = shelf->max_version;
 
   if (! quiet)


Reply via email to